From 74111ce590ec8b40ee48e828c238bbfb1bf41aaa Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 6 Jun 2017 07:51:42 -0700 Subject: [PATCH] Continue to blacklist the utun interfaces on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were two more places that blacklisted certain interface types that commit e579c822c5bedf5e626e4eb72db3b49a4a4015dc didn't catch. This commit adds those two. Task-number: QTBUG-61263 Change-Id: Ia58d0480a9169f0f121aec03bf2e8900a58939cd Reviewed-by: Tony Sarajärvi --- tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp | 7 +++++++ tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index cd1de209da..c4432c83ee 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -938,9 +938,16 @@ void tst_QTcpServer::linkLocal() //Windows preallocates link local addresses to interfaces that are down. //These may or may not work depending on network driver (they do not work for the Bluetooth PAN driver) if (iface.flags() & QNetworkInterface::IsUp) { +#if defined(Q_OS_WIN) // Do not connect to the Teredo Tunneling interface on Windows Xp. if (iface.humanReadableName() == QString("Teredo Tunneling Pseudo-Interface")) continue; +#elif defined(Q_OS_DARWIN) + // Do not add "utun" interfaces on macOS: nothing ever gets received + // (we don't know why) + if (iface.name().startsWith("utun")) + continue; +#endif foreach (QNetworkAddressEntry addressEntry, iface.addressEntries()) { QHostAddress addr = addressEntry.ip(); if (addr.isInSubnet(localMaskv4, 16)) { diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index b476fdd334..43d0781083 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1638,9 +1638,16 @@ void tst_QUdpSocket::linkLocalIPv4() //Windows preallocates link local addresses to interfaces that are down. //These may or may not work depending on network driver (they do not work for the Bluetooth PAN driver) if (iface.flags() & QNetworkInterface::IsUp) { +#if defined(Q_OS_WIN) // Do not add the Teredo Tunneling Pseudo Interface on Windows. if (iface.humanReadableName().contains("Teredo")) continue; +#elif defined(Q_OS_DARWIN) + // Do not add "utun" interfaces on macOS: nothing ever gets received + // (we don't know why) + if (iface.name().startsWith("utun")) + continue; +#endif foreach (QNetworkAddressEntry addr, iface.addressEntries()) { if (addr.ip().isInSubnet(localMask, 16)) { addresses << addr.ip();