Fix multicast join/leave when binding to QHostAddress::Any.
authorRobin Burchell <robin+qt@viroteck.net>
Fri, 30 Mar 2012 14:23:24 +0000 (16:23 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 2 Apr 2012 10:49:38 +0000 (12:49 +0200)
commitc82d40749dc1ce816333e84d7f3232e59fbe2058
tree340231cf80134be4ac7b3b82cbd522ec320a3e5d
parentc7f8f459bd9bb388aa06d2fb4564012d3eec3906
Fix multicast join/leave when binding to QHostAddress::Any.

On OS X and Windows, this was not working, because the socket was being bound
in v6 mode (due to ::Any being for dual mode), but the address passed was a v4
address, meaning it took the wrong codepath. Linux, strangely, apparently works
anyway.

This is fixable in OS X (by using the v6 join path when bound in v6/dual mode),
but the same fix doesn't work on Windows, failing with WSAEADDRNOTAVAIL.

Don't allow this behaviour, and provide a sane error message telling the user
what to do instead.

Done-with: Shane Kearns
Task-number: QTBUG-25047
Change-Id: Iaf5bbee82e13ac92e11b60c558f5af9ce26f474b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
examples/network/multicastreceiver/receiver.cpp
src/network/socket/qnativesocketengine.cpp
src/network/socket/qudpsocket.cpp
tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp