tst_qudpsocket: Blacklist "utun" interfaces on Darwin

Packets sent to to link-local addresses on it are never received. We
don't know why this happens, as the tooling provided by Apple for
development is close to useless. So we just ignore this interface.

Task-number: QTBUG-61041
Change-Id: Ia608df1fff6bdee5238e107d8a50292a1f9e5c03
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
bb10
Thiago Macieira 2017-05-26 13:33:29 -07:00
parent 2a0d96daa8
commit e579c822c5
1 changed files with 8 additions and 0 deletions

View File

@ -1553,9 +1553,17 @@ void tst_QUdpSocket::linkLocalIPv6()
//Windows preallocates link local addresses to interfaces that are down.
//These may or may not work depending on network 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 addressEntry, iface.addressEntries()) {
QHostAddress addr(addressEntry.ip());
if (!addr.scopeId().isEmpty() && addr.isInSubnet(localMask, 64)) {