From ac8fe3e6454058025f2948767107fce2bedc1a8c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 25 Aug 2023 22:07:36 -0700 Subject: [PATCH] QtNetworkSettings: narrow down hasIPv6 to specific OSes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim --- tests/auto/network-settings.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 50955781c23..c75c4d0eed5 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -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; }