Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-137430

QNetworkInterface::allInterfaces() produces garbled (non human-readable) output for one device

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.9.0
    • Network
    • None

    Description

      The output of  qDebug() << QNetworkInterface::allInterfaces() produces a few lines, then truncates the output: 

      QNetworkInterface::allInterfaces(): 
      QList(
      QNetworkInterface(name = "ethernet_32772", hardware address = "C8:5A:CF:30:D3:45", flags = CanBroadcast CanMulticast , entries = QList(address = QHostAddress("fe80::a8ef:f42b:4f01:7fd9%ethernet_32772"), netmask = QHostAddress("ffff:ffff:ffff:ffff::"), address = QHostAddress("169.254.70.56"), netmask = QHostAddress("255.255.0.0"), broadcast = QHostAddress("169.254.255.255"))), 
      QNetworkInterface(name = "iftype53_32770", hardware address = "", flags = IsUp IsRunning CanBroadcast CanMulticast , entries = QList(address = QHostAddress("fe80::723e:7ca:789d:a5aa%iftype53_32770"), netmask = QHostAddress("ffff:ffff:ffff:ffff::"), address = QHostAddress("100.104.218.102"), netmask = QHostAddress("255.192.0.0"), broadcast = QHostAddress("100.127.255.255"))), 
      {{QNetworkInterface(name = "iftype53_32768", hardware address = "00:FF:BB:BF:6E:C9", flags = IsUp IsRunning CanBroadcast CanMulticast , entries = QList(address = QHostAddress("f0 �A  }}

      i.e. three binary characters, then output truncated.

       

      However, the issue might lie with qDebug, because this code produces proper output: 

          for (const auto &networkDevice : QNetworkInterface::allInterfaces())
              qDebug() << networkDevice;

      QNetworkInterface(name = "ethernet_32772", hardware address = "C8:5A:CF:30:D3:45", flags = CanBroadcast CanMulticast , entries = QList(address = QHostAddress("fe80::a8ef:f42b:4f01:7fd9%ethernet_32772"), netmask = QHostAddress("ffff:ffff:ffff:ffff::"), address = QHostAddress("169.254.70.56"), netmask = QHostAddress("255.255.0.0"), broadcast = QHostAddress("169.254.255.255")))
      QNetworkInterface(name = "iftype53_32770", hardware address = "", flags = IsUp IsRunning CanBroadcast CanMulticast , entries = QList(address = QHostAddress("fe80::723e:7ca:789d:a5aa%iftype53_32770"), netmask = QHostAddress("ffff:ffff:ffff:ffff::"), address = QHostAddress("100.104.218.102"), netmask = QHostAddress("255.192.0.0"), broadcast = QHostAddress("100.127.255.255")))
      QNetworkInterface(name = "iftype53_32768", hardware address = "00:FF:BB:BF:6E:C9", flags = IsUp IsRunning CanBroadcast CanMulticast , entries = QList(address = QHostAddress("fe80::a5ba:e271:6b37:803c%iftype53_32768"), netmask = QHostAddress("ffff:ffff:ffff:ffff::"), address = QHostAddress("10.100.0.2"), netmask = QHostAddress("255.255.0.0"), broadcast = QHostAddress("10.100.255.255")))

      Line is not truncated, and qDebug() continues with the output.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            manordheim Mårten Nordheim
            mborsuk mborsuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes