Previously in Windows using Qt4, I was doing the following to join a source membership for UDP multicast:
Qt Code:
  1. int socketfd = m_RadarMulticastUdpSocket->socketDescriptor();
  2.  
  3. // set TTL (Time To Live)
  4. unsigned int ttl = 30; // restricted to 38 hops
  5. if (setsockopt(socketfd, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&ttl, sizeof(ttl)) < 0)
  6. {
  7. return (1);
  8. }
  9.  
  10. ip_mreq_source mreq;
  11. memset(&mreq, 0, sizeof(ip_mreq));
  12. mreq.imr_multiaddr.s_addr = inet_addr("230.0.10.1");
  13. mreq.imr_interface.s_addr = inet_addr(qPrintable(NicAddress));
  14. mreq.imr_sourceaddr.s_addr = ipaddress;
  15. if (setsockopt(socketfd, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, (char*)&mreq, sizeof(mreq)) < 0)
  16. {
  17. return (1);
  18. }
To copy to clipboard, switch view to plain text mode 
When I try the same thing in Qt5, it does not work. I would guess the socket descriptor changed in some way. It is not returning -1 nor am I using any QNetworkProxy. Did anything with socketDescriptor() change?

So, I want to use QUdpSocket::joinMulticastGroup() and not be concerned with OS specific calls, but have not found a way to only join the multicast group that originates from a specified source. Did I miss something or is it really missing? I have a workaround (filtering after I get each packet) that is not the most efficient way of doing this.