Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
5.11.1
-
None
-
Qt 5.11.1 on Debian Buster (Testing)
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).