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

QNetworkInterface::Unknown for all interfaces on Android 11

    XMLWordPrintable

Details

    • Android
    • 21
    • Foundation PM Staging

    Description

      I run code below on Pixel 3A with Android 11.
      It prints:

      QNetworkInterface::Unknown QHostAddress("10.108.19.194") QAbstractSocket::IPv4Protocol "rmnet_data1"
      QNetworkInterface::Unknown QHostAddress("192.168.1.121") QAbstractSocket::IPv4Protocol "wlan0"
      QNetworkInterface::Unknown QHostAddress("127.0.0.1") QAbstractSocket::IPv4Protocol "lo"
      

      As can you see `ifc.type()` always return `QNetworkInterface::Unknown`.
      I expect QNetworkInterface::Wifi for "wlan0", 192.168.1.121 this is address that gives wifi router to phone, "rmnet_data1" is 4G network interface (have no idea what proper QNetworkInterface::InterfaceType), and "lo" should have QNetworkInterface::Loopback type.

          auto interfaces = QNetworkInterface::allInterfaces();
          for (const auto &ifc : interfaces) {
              const auto container = ifc.addressEntries();
              for (const auto &addr : container) {
                  qDebug() << ifc.type() << addr.ip() << addr.ip().protocol() << ifc.name();
              }
          }
      

      Attachments

        Issue Links

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

          Activity

            People

              cnn Qt Core & Network
              evgeniy_dushistov evgeniy_dushistov
              Vladimir Minenko Vladimir Minenko
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes