Commit 390a44a9 authored by ValdikSS ValdikSS's avatar ValdikSS ValdikSS Committed by Simon Redman
Browse files

Really set source IP for broadcast discovery packets on Windows/FreeBSD

This whole code was no-op: it enumerates network interfaces, enumerates
its IP addresses, but does not change the address of broadcast UDP
packet, sending it only via default route/interface.

Bind the socket to IP addresses of the interfaces to fix the issue.

BUG: 459171
parent 8cfa3081
Pipeline #249712 passed with stage
in 3 minutes and 32 seconds
......@@ -171,6 +171,7 @@ void LanLinkProvider::broadcastToNetwork()
QHostAddress sourceAddress = ifaceAddress.ip();
if (sourceAddress.protocol() == QAbstractSocket::IPv4Protocol && sourceAddress != QHostAddress::LocalHost) {
qCDebug(KDECONNECT_CORE()) << "Broadcasting as" << sourceAddress;
sendSocket.bind(sourceAddress);
sendBroadcasts(sendSocket, np, destinations);
sendSocket.close();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment