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

Cannot set socket option TTL on Windows 7 with IPv4 connection

    XMLWordPrintable

Details

    Description

      IPv4 and IPv6 have different APIs for Multicast socket options. When you set TTL or Multicast Loopback socket options Qt picks up the API based on the socket's address family. By default in Qt's native socket implementation (qnativesocketengine_win.cpp) the address family on Windows 7 is IPv6. In that case the Multicast options are set according to the API for IPv6 while the settings for IPv4 remain unchanged. Now, when you send data the Multicast options are wrong if you don't have IPv6 connection.

      There is a workaround to bind the socket to QHostAddress::AnyIPv4 when the IPv4 API is used, but the Qt Network module should handle both versions itself. Could it be possible to set the options using both IPv4 and IPv6 APIs?

      The problem can be reproduced with Qt Example Multicast Sender (start sending and then change the TTL) and e.g. Wireshark to capture the data packets and read the headers.

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes