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

QUdpSocket can not receive IPv6 multicast packets if the socket is bound to specific address

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 5.11.1
    • Network: Sockets
    • None
    • Qt 5.11.1 on Debian Buster (Testing)
    • Linux/X11

    Description

      I noticed that QUdpSocket is not able to receive multicast packets if the socket is connected to a specific IPv6 address instead of QHostAddress::AnyIPv6.

      This (simplified) code does not work on Linux but works on Windows:

      QUdpSocket* socket = new QUdpSocket(this);
      socket->bind(linkLocalAddressEth0, port); // success
      socket->joinMulticastGroup(ipv6MulticastAddress, interfaceEth0); // success
      // can not receive multicast packets on eth0 (no signals received)
      

      I verified with Wireshark that I receive IPv6 multicast packets on eth0. netstat -g shows that eth0 is indeed member of the correct multicast group after calling joinMulticastGroup. But still no packets are received in the application. Omitting the interface on the joinMulticastGroup call has no effect.

      The identical code works if I bind the socket to QHostAddress::AnyIPv6 instead. I did not test IPv4.

      A demo project is attached (see comment below).

      Attachments

        1. udpmulticasttest.h
          2 kB
        2. udp_multicast_test.pro
          0.8 kB
        3. test.py
          0.4 kB
        4. sender.py
          0.1 kB
        5. main.cpp
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            xblax xblax
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes