QtNetworkSettings: narrow down hasIPv6 to specific OSes

It's currently conditional on two features used in QNetworkInterface.
The fact that QNetworkInterface misses those two features is probably
correlated to the failures observed on QNX, but is not the cause, so
this code was actually wrong and was possibly disabling the execution of
similar content on other OSes.

Therefore, this commit removes them and changes the conditional to
exclude the OS that is failing (QNX).

I find this situation unacceptable.  IPv6 support is mandatory for any
application after 2011-01-31, the date when IANA delegated its last IP
block, and definitely after 2019-11-25, when RIPE NCC ran completely
out. But since there's no SDK available for it, I'll grudgingly accept a
grandfathered exception because there's nothing I can do about it (I
tried to fix it; look at the change history of this patch set). I will
block any new OSes in that situation, though.

Task-number: QTBUG-116503
Change-Id: Ifa1111900d6945ea8e05fffd177ed6979c3e5916
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Thiago Macieira 2023-08-25 22:07:36 -07:00
parent fd924ab0b6
commit ac8fe3e645

View File

@ -92,8 +92,11 @@ public:
static bool hasIPv6()
{
#ifdef Q_OS_UNIX
#if !defined(QT_NO_GETIFADDRS) && !defined(QT_NO_IPV6IFNAME)
#if defined(Q_OS_QNX)
// Qt's support for IPv6 on QNX appears to be broken.
// This is an unaccepable situation after 2011-01-31.
return false;
#elif defined(Q_OS_UNIX)
int s = ::socket(AF_INET6, SOCK_DGRAM, 0);
if (s == -1)
return false;
@ -108,9 +111,6 @@ public:
}
}
::close(s);
#else
return false;
#endif
#endif
return true;
}