LanLinkProvider: Bind the UDP server socket to Any, not Broadcast.

Trying to bind a UDP socket to 255.255.255.255 fails with EADDRNOTAVAIL
at least on FreeBSD.

The sender side on Android should send its message in broadcast mode (as
it already does), but the receiver side should bind to INADDR_ANY, not
INADDR_BROADCAST.

BUG:	324769
REVIEW:	118870
This commit is contained in:
Raphael Kubo da Costa 2014-06-22 14:17:16 +03:00
parent 5a91db4427
commit 2df8a8064f

View file

@ -68,7 +68,7 @@ LanLinkProvider::LanLinkProvider()
void LanLinkProvider::onStart() void LanLinkProvider::onStart()
{ {
bool buildSucceed = mUdpServer->bind(QHostAddress::Broadcast, port, QUdpSocket::ShareAddress); bool buildSucceed = mUdpServer->bind(QHostAddress::Any, port, QUdpSocket::ShareAddress);
Q_ASSERT(buildSucceed); Q_ASSERT(buildSucceed);
mTcpPort = port; mTcpPort = port;