diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-05-25 14:26:51 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-26 00:09:55 +0200 |
commit | 385692b3ad12f35d0008bc4b309225fcaac0010d (patch) | |
tree | 95ec8803337a33ca52ed1c0cc504f1ab028b21df /src/network/socket/qnativesocketengine_win.cpp | |
parent | 1a4ff6f122f575aca21f6a0b9d9c14cac4a5ea66 (diff) |
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 <rich@kde.org>
Diffstat (limited to 'src/network/socket/qnativesocketengine_win.cpp')
-rw-r--r-- | src/network/socket/qnativesocketengine_win.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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) |