Commit e468759d authored by Weixuan Xiao's avatar Weixuan Xiao
Browse files

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
parent 182fd5f2
Pipeline #206739 passed with stage
in 4 minutes and 59 seconds
......@@ -173,8 +173,8 @@ void LanLinkProvider::broadcastToNetwork()
}
#endif
#ifdef Q_OS_WIN
//On Windows we need to broadcast from every local IP address to reach all networks
#if defined(Q_OS_WIN) || defined(Q_OS_FREEBSD)
//On Windows and FreeBSD we need to broadcast from every local IP address to reach all networks
QUdpSocket sendSocket;
sendSocket.setProxy(QNetworkProxy::NoProxy);
for (const QNetworkInterface& iface : QNetworkInterface::allInterfaces()) {
......
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