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
This commit is contained in:
parent
8cfa308140
commit
390a44a901
1 changed files with 1 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue