From 385692b3ad12f35d0008bc4b309225fcaac0010d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 25 May 2014 14:26:51 -0700 Subject: IPv6 scope ID of zero is not valid IANA reserves scope ID of 0x0 to mean "no scope ID", so make sure that we don't try to set it when reading from the sockaddr_in6 structure. Change-Id: I71b207e6f8262ab2bf9fde993288a71ba63c7572 Reviewed-by: Richard J. Moore --- src/network/socket/qnativesocketengine_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/network/socket/qnativesocketengine_win.cpp') diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index b1c9073eb9..138d046bfc 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -182,7 +182,8 @@ static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt if (address) { QHostAddress a; a.setAddress(tmp); - a.setScopeId(QString::number(sa6->sin6_scope_id)); + if (sa6->sin6_scope_id) + a.setScopeId(QString::number(sa6->sin6_scope_id)); *address = a; } if (port) -- cgit v1.2.3