diff --git a/configure b/configure index 6f2d4ffe67..35aea298ff 100755 --- a/configure +++ b/configure @@ -778,7 +778,6 @@ CFG_SSE4_1=auto CFG_SSE4_2=auto CFG_AVX=auto CFG_REDUCE_RELOCATIONS=no -CFG_IPV6=auto CFG_NAS=no CFG_QWS_DEPTHS=all CFG_USER_BUILD_KEY= @@ -3691,10 +3690,6 @@ if [ "$OPT_HELP" = "yes" ]; then SHY=" " SHN="*" fi - if [ "$CFG_IPV6" = "auto" ]; then - I6Y="*" - I6N=" " - fi if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then PHY=" " PHN="*" @@ -6598,26 +6593,6 @@ if [ "$CFG_STL" != "no" ]; then fi fi -# find if the platform supports IPv6 -if [ "$CFG_IPV6" != "no" ]; then - if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then - #IPV6 should always be enabled for Symbian release - CFG_IPV6=yes - elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then - CFG_IPV6=yes - else - if [ "$CFG_IPV6" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then - echo "IPv6 support cannot be enabled due to functionality tests!" - echo " Turn on verbose messaging (-v) to $0 to see the final report." - echo " If you believe this message is in error you may use the continue" - echo " switch (-continue) to $0 to continue." - exit 101 - else - CFG_IPV6=no - fi - fi -fi - # detect POSIX clock_gettime() if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/clock-gettime "POSIX clock_gettime()" $L_FLAGS $I_FLAGS $l_FLAGS; then @@ -7155,9 +7130,6 @@ fi [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt" [ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon" [ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS" -if [ "$CFG_IPV6" = "yes" ]; then - QT_CONFIG="$QT_CONFIG ipv6" -fi if [ "$CFG_CLOCK_GETTIME" = "yes" ]; then QT_CONFIG="$QT_CONFIG clock-gettime" fi @@ -8203,7 +8175,6 @@ QMakeVar set sql-plugins "$SQL_PLUGINS" [ "$CFG_ZLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB" [ "$CFG_S60" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_S60" [ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS" -[ "$CFG_IPV6" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6" [ "$CFG_SXE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE" [ "$CFG_DBUS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS" @@ -8716,7 +8687,6 @@ if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then echo "NEON support ........... ${CFG_NEON}" fi [ "${PLATFORM_QWS}" != "yes" -a "${PLATFORM_QPA}" != "yes" ] && echo "Graphics System ........ $CFG_GRAPHICS_SYSTEM" -echo "IPv6 support ........... $CFG_IPV6" echo "IPv6 ifname support .... $CFG_IPV6IFNAME" echo "getaddrinfo support .... $CFG_GETADDRINFO" echo "getifaddrs support ..... $CFG_GETIFADDRS" diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index bff351c34f..24048113ac 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -65,7 +65,6 @@ QT_BEGIN_NAMESPACE } while (0) #ifdef Q_OS_WIN -# if !defined (QT_NO_IPV6) // sockaddr_in6 size changed between old and new SDK // Only the new version is the correct one, so always // use this structure. @@ -90,12 +89,6 @@ typedef struct { struct qt_in6_addr sin6_addr; /* IPv6 address */ u_long sin6_scope_id; /* set of interfaces for a scope */ } qt_sockaddr_in6; -# else -typedef void * qt_sockaddr_in6 ; -# endif -# ifndef AF_INET6 -# define AF_INET6 23 /* Internetwork Version 6 */ -# endif #else #define qt_sockaddr_in6 sockaddr_in6 #define qt_s6_addr s6_addr @@ -545,10 +538,8 @@ QHostAddress::QHostAddress(const struct sockaddr *sockaddr) { if (sockaddr->sa_family == AF_INET) setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr)); -#ifndef QT_NO_IPV6 else if (sockaddr->sa_family == AF_INET6) setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr); -#endif } /*! @@ -700,10 +691,8 @@ void QHostAddress::setAddress(const struct sockaddr *sockaddr) clear(); if (sockaddr->sa_family == AF_INET) setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr)); -#ifndef QT_NO_IPV6 else if (sockaddr->sa_family == AF_INET6) setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr); -#endif } /*! diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index 0a56bc309a..37444ae2d9 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -149,9 +149,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) // Reverse lookups using getnameinfo are broken on darwin, use gethostbyaddr instead. #if !defined (QT_NO_GETADDRINFO) && !defined (Q_OS_DARWIN) sockaddr_in sa4; -#ifndef QT_NO_IPV6 sockaddr_in6 sa6; -#endif sockaddr *sa = 0; QT_SOCKLEN_T saSize = 0; if (address.protocol() == QAbstractSocket::IPv4Protocol) { @@ -161,7 +159,6 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) sa4.sin_family = AF_INET; sa4.sin_addr.s_addr = htonl(address.toIPv4Address()); } -#ifndef QT_NO_IPV6 else { sa = (sockaddr *)&sa6; saSize = sizeof(sa6); @@ -169,7 +166,6 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) sa6.sin6_family = AF_INET6; memcpy(sa6.sin6_addr.s6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr.s6_addr)); } -#endif char hbuf[NI_MAXHOST]; if (sa && getnameinfo(sa, saSize, hbuf, sizeof(hbuf), 0, 0, 0) == 0) @@ -231,7 +227,6 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) if (!addresses.contains(addr)) addresses.append(addr); } -#ifndef QT_NO_IPV6 else if (node->ai_family == AF_INET6) { QHostAddress addr; sockaddr_in6 *sa6 = (sockaddr_in6 *) node->ai_addr; @@ -241,7 +236,6 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) if (!addresses.contains(addr)) addresses.append(addr); } -#endif node = node->ai_next; } if (addresses.isEmpty() && node == 0) { diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp index 0ce21f905f..528e195ef6 100644 --- a/src/network/kernel/qnetworkinterface_unix.cpp +++ b/src/network/kernel/qnetworkinterface_unix.cpp @@ -80,10 +80,9 @@ static QHostAddress addressFromSockaddr(sockaddr *sa) if (sa->sa_family == AF_INET) address.setAddress(htonl(((sockaddr_in *)sa)->sin_addr.s_addr)); -#ifndef QT_NO_IPV6 else if (sa->sa_family == AF_INET6) address.setAddress(((sockaddr_in6 *)sa)->sin6_addr.s6_addr); -#endif + return address; } diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 9afb21155b..5bad8ec1df 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1003,17 +1003,6 @@ void QAbstractSocketPrivate::_q_connectToNextAddress() host.toString().toLatin1().constData(), port, addresses.count()); #endif -#if defined(QT_NO_IPV6) - if (host.protocol() == QAbstractSocket::IPv6Protocol) { - // If we have no IPv6 support, then we will not be able to - // connect. So we just pretend we didn't see this address. -#if defined(QABSTRACTSOCKET_DEBUG) - qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), skipping IPv6 entry"); -#endif - continue; - } -#endif - if (!initSocketLayer(host.protocol())) { // hope that the next address is better #if defined(QABSTRACTSOCKET_DEBUG) diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 875852265e..2dc6a40d99 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -203,6 +203,7 @@ void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, Er case BroadcastingInitFailedErrorString: socketErrorString = QNativeSocketEngine::tr("Unable to initialize broadcast socket"); break; + // should not happen anymore case NoIpV6ErrorString: socketErrorString = QNativeSocketEngine::tr("Attempt to use IPv6 socket on a platform with no IPv6 support"); break; @@ -345,14 +346,6 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb if (isValid()) close(); -#if defined(QT_NO_IPV6) - if (protocol == QAbstractSocket::IPv6Protocol) { - d->setError(QAbstractSocket::UnsupportedSocketOperationError, - QNativeSocketEnginePrivate::NoIpV6ErrorString); - return false; - } -#endif - // Create the socket if (!d->createNewSocket(socketType, protocol)) { #if defined (QNATIVESOCKETENGINE_DEBUG) @@ -511,13 +504,6 @@ bool QNativeSocketEngine::connectToHost(const QHostAddress &address, quint16 por Q_D(QNativeSocketEngine); Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::connectToHost(), false); -#if defined (QT_NO_IPV6) - if (address.protocol() == QAbstractSocket::IPv6Protocol) { - d->setError(QAbstractSocket::UnsupportedSocketOperationError, - QNativeSocketEnginePrivate::NoIpV6ErrorString); - return false; - } -#endif if (!d->checkProxy(address)) return false; @@ -581,13 +567,6 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port) Q_D(QNativeSocketEngine); Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bind(), false); -#if defined (QT_NO_IPV6) - if (address.protocol() == QAbstractSocket::IPv6Protocol) { - d->setError(QAbstractSocket::UnsupportedSocketOperationError, - QNativeSocketEnginePrivate::NoIpV6ErrorString); - return false; - } -#endif if (!d->checkProxy(address)) return false; diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 26053981ce..246b5ede9b 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -124,7 +124,6 @@ static void qt_ignore_sigpipe() */ static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *port, QHostAddress *addr) { -#if !defined(QT_NO_IPV6) if (s->a.sa_family == AF_INET6) { Q_IPV6ADDR tmp; memcpy(&tmp, &s->a6.sin6_addr, sizeof(tmp)); @@ -144,7 +143,7 @@ static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *po *port = ntohs(s->a6.sin6_port); return; } -#endif + if (port) *port = ntohs(s->a4.sin_port); if (addr) { @@ -162,12 +161,7 @@ static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *po bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol socketProtocol) { -#ifndef QT_NO_IPV6 int protocol = (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) ? AF_INET6 : AF_INET; -#else - Q_UNUSED(socketProtocol); - int protocol = AF_INET; -#endif int type = (socketType == QAbstractSocket::UdpSocket) ? SOCK_DGRAM : SOCK_STREAM; int socket = qt_safe_socket(protocol, type, 0); @@ -238,24 +232,20 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co n = SO_KEEPALIVE; break; case QNativeSocketEngine::MulticastTtlOption: -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_HOPS; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_TTL; } break; case QNativeSocketEngine::MulticastLoopbackOption: -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_LOOP; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_LOOP; @@ -343,24 +333,20 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt n = SO_KEEPALIVE; break; case QNativeSocketEngine::MulticastTtlOption: -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_HOPS; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_TTL; } break; case QNativeSocketEngine::MulticastLoopbackOption: -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_LOOP; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_LOOP; @@ -381,7 +367,6 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16 struct sockaddr *sockAddrPtr = 0; QT_SOCKLEN_T sockAddrSize = 0; -#if !defined(QT_NO_IPV6) struct sockaddr_in6 sockAddrIPv6; if (addr.protocol() == QAbstractSocket::IPv6Protocol) { @@ -402,10 +387,6 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16 sockAddrSize = sizeof(sockAddrIPv6); sockAddrPtr = (struct sockaddr *) &sockAddrIPv6; } else -#if 0 - {} -#endif -#endif if (addr.protocol() == QAbstractSocket::IPv4Protocol) { memset(&sockAddrIPv4, 0, sizeof(sockAddrIPv4)); sockAddrIPv4.sin_family = AF_INET; @@ -492,7 +473,7 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &address, quint16 struct sockaddr *sockAddrPtr = 0; QT_SOCKLEN_T sockAddrSize = 0; -#if !defined(QT_NO_IPV6) + struct sockaddr_in6 sockAddrIPv6; if (address.protocol() == QAbstractSocket::IPv6Protocol || address.protocol() == QAbstractSocket::AnyIPProtocol) { @@ -516,7 +497,6 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &address, quint16 sockAddrSize = sizeof(sockAddrIPv6); sockAddrPtr = (struct sockaddr *) &sockAddrIPv6; } else -#endif if (address.protocol() == QAbstractSocket::IPv4Protocol) { memset(&sockAddrIPv4, 0, sizeof(sockAddrIPv4)); sockAddrIPv4.sin_family = AF_INET; @@ -612,7 +592,6 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d, int sockArgSize; ip_mreq mreq4; -#ifndef QT_NO_IPV6 ipv6_mreq mreq6; if (groupAddress.protocol() == QAbstractSocket::IPv6Protocol) { @@ -625,7 +604,6 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d, memcpy(&mreq6.ipv6mr_multiaddr, &ip6, sizeof(ip6)); mreq6.ipv6mr_interface = interface.index(); } else -#endif if (groupAddress.protocol() == QAbstractSocket::IPv4Protocol) { level = IPPROTO_IP; sockOpt = how4; @@ -679,11 +657,7 @@ bool QNativeSocketEnginePrivate::nativeJoinMulticastGroup(const QHostAddress &gr const QNetworkInterface &interface) { return multicastMembershipHelper(this, -#ifndef QT_NO_IPV6 IPV6_JOIN_GROUP, -#else - 0, -#endif IP_ADD_MEMBERSHIP, groupAddress, interface); @@ -693,11 +667,7 @@ bool QNativeSocketEnginePrivate::nativeLeaveMulticastGroup(const QHostAddress &g const QNetworkInterface &interface) { return multicastMembershipHelper(this, -#ifndef QT_NO_IPV6 IPV6_LEAVE_GROUP, -#else - 0, -#endif IP_DROP_MEMBERSHIP, groupAddress, interface); @@ -705,7 +675,6 @@ bool QNativeSocketEnginePrivate::nativeLeaveMulticastGroup(const QHostAddress &g QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const { -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { uint v; QT_SOCKOPTLEN_T sizeofv = sizeof(v); @@ -713,7 +682,6 @@ QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const return QNetworkInterface(); return QNetworkInterface::interfaceFromIndex(v); } -#endif struct in_addr v = { 0 }; QT_SOCKOPTLEN_T sizeofv = sizeof(v); @@ -737,12 +705,10 @@ QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const bool QNativeSocketEnginePrivate::nativeSetMulticastInterface(const QNetworkInterface &iface) { -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { uint v = iface.index(); return (::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_MULTICAST_IF, &v, sizeof(v)) != -1); } -#endif struct in_addr v; if (iface.isValid()) { @@ -871,7 +837,6 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l struct sockaddr *sockAddrPtr = 0; QT_SOCKLEN_T sockAddrSize = 0; -#if !defined(QT_NO_IPV6) struct sockaddr_in6 sockAddrIPv6; if (host.protocol() == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::IPv6Protocol) { @@ -884,7 +849,7 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l sockAddrSize = sizeof(sockAddrIPv6); sockAddrPtr = (struct sockaddr *)&sockAddrIPv6; } else -#endif + if (host.protocol() == QAbstractSocket::IPv4Protocol) { memset(&sockAddrIPv4, 0, sizeof(sockAddrIPv4)); sockAddrIPv4.sin_family = AF_INET; @@ -941,11 +906,9 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters() case AF_INET: socketProtocol = QAbstractSocket::IPv4Protocol; break; -#if !defined (QT_NO_IPV6) case AF_INET6: socketProtocol = QAbstractSocket::IPv6Protocol; break; -#endif default: socketProtocol = QAbstractSocket::UnknownNetworkLayerProtocol; break; diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index ba62bd6da2..67a9a2131a 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -165,7 +165,6 @@ static QByteArray qt_prettyDebug(const char *data, int len, int maxLength) */ static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt_sockaddr *sa, quint16 *port, QHostAddress *address) { -#if !defined (QT_NO_IPV6) if (sa->a.sa_family == AF_INET6) { const qt_sockaddr_in6 *sa6 = &sa->a6; Q_IPV6ADDR tmp; @@ -178,7 +177,7 @@ static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt if (port) WSANtohs(socketDescriptor, sa6->sin6_port, port); } else -#endif + if (sa->a.sa_family == AF_INET) { const sockaddr_in *sa4 = &sa->a4; unsigned long addr; @@ -200,7 +199,7 @@ static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt void QNativeSocketEnginePrivate::setPortAndAddress(sockaddr_in * sockAddrIPv4, qt_sockaddr_in6 * sockAddrIPv6, quint16 port, const QHostAddress & address, sockaddr ** sockAddrPtr, QT_SOCKLEN_T *sockAddrSize) { -#if !defined(QT_NO_IPV6) + if (address.protocol() == QAbstractSocket::IPv6Protocol || address.protocol() == QAbstractSocket::AnyIPProtocol || socketProtocol == QAbstractSocket::IPv6Protocol) { @@ -213,7 +212,7 @@ void QNativeSocketEnginePrivate::setPortAndAddress(sockaddr_in * sockAddrIPv4, q *sockAddrSize = sizeof(qt_sockaddr_in6); *sockAddrPtr = (struct sockaddr *) sockAddrIPv6; } else -#endif + if (address.protocol() == QAbstractSocket::IPv4Protocol || address.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol) { memset(sockAddrIPv4, 0, sizeof(sockaddr_in)); @@ -403,24 +402,21 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co n = SO_KEEPALIVE; break; case QNativeSocketEngine::MulticastTtlOption: -#ifndef QT_NO_IPV6 + if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_HOPS; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_TTL; } break; case QNativeSocketEngine::MulticastLoopbackOption: -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_LOOP; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_LOOP; @@ -487,24 +483,20 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt n = SO_KEEPALIVE; break; case QNativeSocketEngine::MulticastTtlOption: -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_HOPS; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_TTL; } break; case QNativeSocketEngine::MulticastLoopbackOption: -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { level = IPPROTO_IPV6; n = IPV6_MULTICAST_LOOP; } else -#endif { level = IPPROTO_IP; n = IP_MULTICAST_LOOP; @@ -545,11 +537,9 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters() case AF_INET: socketProtocol = QAbstractSocket::IPv4Protocol; break; -#if !defined (QT_NO_IPV6) case AF_INET6: socketProtocol = QAbstractSocket::IPv6Protocol; break; -#endif default: socketProtocol = QAbstractSocket::UnknownNetworkLayerProtocol; break; @@ -714,7 +704,7 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &a, quint16 port) // binding to a multicast address address = QHostAddress(QHostAddress::AnyIPv6); } -#if !defined (QT_NO_IPV6) && defined (IPV6_V6ONLY) +#if defined (IPV6_V6ONLY) //This is default in current windows versions, it may change in future so set it explicitly if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) { ipv6only = 1; @@ -729,7 +719,7 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &a, quint16 port) } break; case QAbstractSocket::AnyIPProtocol: -#if !defined (QT_NO_IPV6) && defined (IPV6_V6ONLY) +#if defined (IPV6_V6ONLY) if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) ); else @@ -849,7 +839,6 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d, int sockArgSize; struct ip_mreq mreq4; -#ifndef QT_NO_IPV6 struct ipv6_mreq mreq6; if (groupAddress.protocol() == QAbstractSocket::IPv6Protocol) { @@ -862,7 +851,7 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d, memcpy(&mreq6.ipv6mr_multiaddr, &ip6, sizeof(ip6)); mreq6.ipv6mr_interface = iface.index(); } else -#endif + if (groupAddress.protocol() == QAbstractSocket::IPv4Protocol) { level = IPPROTO_IP; sockOpt = how4; @@ -904,11 +893,7 @@ bool QNativeSocketEnginePrivate::nativeJoinMulticastGroup(const QHostAddress &gr const QNetworkInterface &iface) { return multicastMembershipHelper(this, -#ifndef QT_NO_IPV6 IPV6_JOIN_GROUP, -#else - 0, -#endif IP_ADD_MEMBERSHIP, groupAddress, iface); @@ -918,11 +903,7 @@ bool QNativeSocketEnginePrivate::nativeLeaveMulticastGroup(const QHostAddress &g const QNetworkInterface &iface) { return multicastMembershipHelper(this, -#ifndef QT_NO_IPV6 IPV6_LEAVE_GROUP, -#else - 0, -#endif IP_DROP_MEMBERSHIP, groupAddress, iface); @@ -930,7 +911,6 @@ bool QNativeSocketEnginePrivate::nativeLeaveMulticastGroup(const QHostAddress &g QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const { -#ifndef QT_NO_IPV6 if (socketProtocol == QAbstractSocket::IPv6Protocol) { uint v; QT_SOCKOPTLEN_T sizeofv = sizeof(v); @@ -938,7 +918,6 @@ QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const return QNetworkInterface(); return QNetworkInterface::interfaceFromIndex(v); } -#endif struct in_addr v; v.s_addr = 0; @@ -965,12 +944,11 @@ QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const bool QNativeSocketEnginePrivate::nativeSetMulticastInterface(const QNetworkInterface &iface) { -#ifndef QT_NO_IPV6 + if (socketProtocol == QAbstractSocket::IPv6Protocol) { uint v = iface.isValid() ? iface.index() : 0; return (::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_MULTICAST_IF, (char *) &v, sizeof(v)) != -1); } -#endif struct in_addr v; if (iface.isValid()) { diff --git a/src/network/socket/qudpsocket.cpp b/src/network/socket/qudpsocket.cpp index 6bc93dd7f0..009ce92d8e 100644 --- a/src/network/socket/qudpsocket.cpp +++ b/src/network/socket/qudpsocket.cpp @@ -192,15 +192,6 @@ bool QUdpSocketPrivate::doEnsureInitialized(const QHostAddress &bindAddress, qui proto = address->protocol(); } -#if defined(QT_NO_IPV6) - Q_Q(QUdpSocket); - if (proto == QUdpSocket::IPv6Protocol) { - socketError = QUdpSocket::UnsupportedSocketOperationError; - q->setErrorString(QUdpSocket::tr("This platform does not support IPv6")); - return false; - } -#endif - // now check if the socket engine is initialized and to the right type if (!socketEngine || !socketEngine->isValid()) { resolveProxy(remoteAddress.toString(), bindPort); diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index beeb6c7655..b566e5cebd 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -281,9 +281,6 @@ void tst_QTcpServer::dualStack_data() void tst_QTcpServer::dualStack() { -#ifdef QT_NO_IPV6 - QSKIP("test requires IPv6 support", SkipAll); -#else QFETCH_GLOBAL(bool, setProxy); if (setProxy) QSKIP("test server proxy doesn't support ipv6", SkipSingle); @@ -302,7 +299,6 @@ void tst_QTcpServer::dualStack() QCOMPARE(v4client.waitForConnected(5000), v4ok); QCOMPARE(v6client.waitForConnected(5000), v6ok); -#endif } //---------------------------------------------------------------------------------- diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp index 03e224682f..dbb93ad92a 100644 --- a/tests/auto/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp @@ -380,9 +380,6 @@ void tst_QUdpSocket::ipv6Loop_data() void tst_QUdpSocket::ipv6Loop() { -#if defined(QT_NO_IPV6) - QSKIP("IPv6 is not yet supported", SkipAll); -#endif QFETCH(QByteArray, peterMessage); QFETCH(QByteArray, paulMessage); QFETCH(bool, success); diff --git a/tools/configure/configure_pch.h b/tools/configure/configure_pch.h index 33da5f69f2..edf7c04dff 100644 --- a/tools/configure/configure_pch.h +++ b/tools/configure/configure_pch.h @@ -47,9 +47,7 @@ # undef _POSIX_ /* Don't polute */ /* Make sure IP v6 is defined first of all, before windows.h */ -# ifndef QT_NO_IPV6 # include -# endif # include #endif diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 7be1e28d57..698b6a381e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -341,7 +341,6 @@ Configure::Configure(int& argc, char** argv) dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENVG" ] = "no"; - dictionary[ "IPV6" ] = "yes"; // Always, dynamically loaded dictionary[ "OPENSSL" ] = "auto"; dictionary[ "DBUS" ] = "auto"; dictionary[ "S60" ] = "yes"; @@ -1555,8 +1554,6 @@ void Configure::applySpecSpecifics() dictionary[ "QT3SUPPORT" ] = "no"; dictionary[ "OPENGL" ] = "no"; dictionary[ "OPENSSL" ] = "yes"; - // On Symbian we now always will have IPv6 with no chance to disable it - dictionary[ "IPV6" ] = "yes"; dictionary[ "STL" ] = "yes"; dictionary[ "EXCEPTIONS" ] = "yes"; dictionary[ "RTTI" ] = "yes"; @@ -2435,7 +2432,6 @@ bool Configure::verifyConfiguration() nis nas tablet - ipv6 X11 : x11sm xinerama xcursor xfixes xrandr xrender fontconfig xkb Embedded: embedded freetype @@ -2710,11 +2706,6 @@ void Configure::generateOutputVars() else if (dictionary[ "DBUS" ] == "linked") qtConfig += "dbus dbus-linked"; - if (dictionary["IPV6"] == "yes") - qtConfig += "ipv6"; - else if (dictionary["IPV6"] == "no") - qtConfig += "no-ipv6"; - if (dictionary[ "CETEST" ] == "yes") qtConfig += "cetest"; @@ -3188,7 +3179,6 @@ void Configure::generateConfigfiles() if (dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL"; if (dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL"; if (dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS"; - if (dictionary["IPV6"] == "no") qconfigList += "QT_NO_IPV6"; if (dictionary["WEBKIT"] == "no") qconfigList += "QT_NO_WEBKIT"; if (dictionary["DECLARATIVE"] == "no") qconfigList += "QT_NO_DECLARATIVE"; if (dictionary["DECLARATIVE_DEBUG"] == "no") qconfigList += "QDECLARATIVE_NO_DEBUG_PROTOCOL";