ASD
This commit is contained in:
parent
ac16a75795
commit
734b7c9c0a
1 changed files with 3 additions and 0 deletions
|
@ -230,6 +230,7 @@ void LanLinkProvider::sendUdpIdentityPacket(QUdpSocket &socket, const QList<QHos
|
|||
|
||||
for (auto &address : addresses) {
|
||||
qint64 bytes = socket.writeDatagram(payload, address, m_udpBroadcastPort);
|
||||
qWarning() << "Send UDP identity packet to" << address;
|
||||
if (bytes == -1 && socket.error() == QAbstractSocket::DatagramTooLargeError) {
|
||||
// On macOS and FreeBSD, UDP broadcasts larger than MTU get dropped. See:
|
||||
// https://opensource.apple.com/source/xnu/xnu-3789.1.32/bsd/netinet/ip_output.c.auto.html#:~:text=/*%20don%27t%20allow%20broadcast%20messages%20to%20be%20fragmented%20*/
|
||||
|
@ -255,6 +256,8 @@ void LanLinkProvider::udpBroadcastReceived()
|
|||
|
||||
m_udpSocket.readDatagram(datagram.data(), datagram.size(), &sender);
|
||||
|
||||
qWarning() << "Received UDP identity packet";
|
||||
|
||||
if (sender.isLoopback() && !m_testMode)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in a new issue