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

QNetworkInterface methods broken when targeting Android 11 (API-30)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.12, 5.15.2
    • 5.15.0
    • Network
    • None
    • Android
    • e33d40a88476e8a9d4f950fb285c75d0c1a92a2e (qt/qtbase/dev) c07eff7d9477a5a098c76fb2107d9f902c2999ac (qt/qtbase/5.15) ab4e78b435bbd08b2b00f86360c729519846eeaf (qt/qtbase/5.12)

    Description

      Android 11 introduces changes related to MAC addresses that break the functionality of the following QNetworkInterface member functions:

      • QNetworkInterface::interfaceFromName(const QString &name)
      • QNetworkInterface::interfaceFromIndex(int index)
      • QNetworkInterface::allInterfaces()
      • QNetworkInterface::allAddresses()

      The reason for the break is that when targeting API 30 or higher, android blocks RTM_GETLINK netlink messages (Source).
      Maybe this is the corresponding commit for the android sources: Source

      All of the above mentioned functions end up in calling the function getInterfaces(int sock, char *buf) in qtbase/src/network/kernel/qnetworkinterface_linux.cpp

      As the netlink request with RTM_GETLINK is blocked, no interfaces are returned by this function.

      When calling QNetworkInterface::allInterfaces(), the function scan() also calls getAddresses(...) that successfully gets the available ip addresses with the corresponding interfaces. As it tries to check against the previously (not) found interfaces (that couldn't be catched), it generates the warnings that can be seen in the logcat of the attached example.

      I rkinterfacetes: Late-enabling -Xcheck:jni
      I rkinterfacetes: Unquickening 12 vdex files!
      D ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
      D NetworkSecurityConfig: No Network Security Config specified, using platform default
      D NetworkSecurityConfig: No Network Security Config specified, using platform default
      W System  : ClassLoader referenced unknown path:
      I QtCore  : Start
      I Qt      : qt started
      I AdrenoGLES-0: QUALCOMM build                   : f84f8da, Ie73904e3bd
      I AdrenoGLES-0: Build Date                       : 06/24/20
      I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.31.04.00
      I AdrenoGLES-0: Local Branch                     : gfx-adreno.lnx.2.0
      I AdrenoGLES-0: Remote Branch                    : quic/gfx-adreno.lnx.2.0
      I AdrenoGLES-0: Remote Branch                    : NONE
      I AdrenoGLES-0: Reconstruct Branch               : NOTHING
      I AdrenoGLES-0: Build Config                     : S P 10.0.4 AArch32
      I AdrenoGLES-0: Driver Path                      : /vendor/lib/egl/libGLESv2_adreno.so
      I AdrenoGLES-0: PFP: 0x016ee189, ME: 0x00000000
      W AdrenoUtils: <ReadGpuID_from_sysfs:197>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model
      W AdrenoUtils: <ReadGpuID:221>: Failed to read chip ID from gpu_model. Fallback to use the GSL path
      I Gralloc4: mapper 4.x is not supported
      W qtMainLoopThrea: type=1400 audit(0.0:74932): avc: denied { nlmsg_readpriv } for scontext=u:r:untrusted_app:s0:c30,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c30,c257,c512,c768 tclass=netlink_route_socket permissive=0 b/155595000 app=org.qtproject.networkinterfacetest
      W         : QNetworkInterface/AF_NETLINK: found unknown interface with index 1
      W         : QNetworkInterface/AF_NETLINK: found unknown interface with index 30
      W         : QNetworkInterface/AF_NETLINK: found unknown interface with index 1
      W         : QNetworkInterface/AF_NETLINK: found unknown interface with index 3
      W         : QNetworkInterface/AF_NETLINK: found unknown interface with index 10
      W         : QNetworkInterface/AF_NETLINK: found unknown interface with index 21
      W         : QNetworkInterface/AF_NETLINK: found unknown interface with index 30
      W         : exit app 0
      "org.qtproject.networkinterfacetest" died.
      

      Maybe this is related to QTBUG-78659.

       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-86394
          # Subject Branch Project Status CR V

          Activity

            People

              thiago Thiago Macieira
              christian.fischerauer Christian Fischerauer
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews