Send broadcast on each LAN interfaces on FreeBSD
On FreeBSD 12 or later, a new routing strategy is introduced, which prevents broadcast using 255.255.255.255. Thus, we need to explicitly send the broadcast to each network interfaces. Here the commit can simply reuse the code for Windows. Ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252596
This commit is contained in:
parent
182fd5f279
commit
e468759df4
1 changed files with 2 additions and 2 deletions
|
@ -173,8 +173,8 @@ void LanLinkProvider::broadcastToNetwork()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#if defined(Q_OS_WIN) || defined(Q_OS_FREEBSD)
|
||||||
//On Windows we need to broadcast from every local IP address to reach all networks
|
//On Windows and FreeBSD we need to broadcast from every local IP address to reach all networks
|
||||||
QUdpSocket sendSocket;
|
QUdpSocket sendSocket;
|
||||||
sendSocket.setProxy(QNetworkProxy::NoProxy);
|
sendSocket.setProxy(QNetworkProxy::NoProxy);
|
||||||
for (const QNetworkInterface& iface : QNetworkInterface::allInterfaces()) {
|
for (const QNetworkInterface& iface : QNetworkInterface::allInterfaces()) {
|
||||||
|
|
Loading…
Reference in a new issue