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

IPv6 instead of IPv4

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P4: Low
    • None
    • 5.5.0
    • Network: Sockets
    • None
    • Windows 7, Qt 5.5, Mingw 4.9.2, Qt 5.6, OS X etc.

    Description

      QTcpServer server;
      server.listen( QHostAddress::Any, portValue ); // The dual stack any-address

      QTcpSocket socket;
      socket.setSocketDescriptor( descriptorValue );
      ...
      On IPv4 connection:
      In Qt 5.4- socket.peerAddress() == QHostAddress( "192.168.13.13" ).
      In Qt 5.5 socket.peerAddress() == QHostAddress( "::ffff:192.168.13.13" ).

      Same for localhost connection 127.0.0.1 versus ::ffff:127.0.0.1.

      Notes:
      1) QHostAddress( "192.168.13.13" ) != QHostAddress( "::ffff:192.168.13.13" )
      2) QHostInfo::​lookupHost does not return QHostAddress( "::ffff:192.168.13.13" ) in the list so this change breaks code checking connection source for (as far as I see) no reason.
      3) With server.listen( QHostAddress::AnyIPv4, portValue ) I get (as expected) normal IPv4 addresses.

      Attachments

        Activity

          People

            thiago Thiago Macieira
            LisandreL LisandreL
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: