From 2df8a8064feb15e9570660d0375b58fa084f570d Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Sun, 22 Jun 2014 14:17:16 +0300 Subject: [PATCH] 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 --- core/backends/lan/lanlinkprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index 2369dc448..13855ffb8 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -68,7 +68,7 @@ LanLinkProvider::LanLinkProvider() void LanLinkProvider::onStart() { - bool buildSucceed = mUdpServer->bind(QHostAddress::Broadcast, port, QUdpSocket::ShareAddress); + bool buildSucceed = mUdpServer->bind(QHostAddress::Any, port, QUdpSocket::ShareAddress); Q_ASSERT(buildSucceed); mTcpPort = port;