diff options
Diffstat (limited to 'src/network/kernel')
-rw-r--r-- | src/network/kernel/qhostinfo_unix.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index b641711..5ca15a3 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -245,7 +245,10 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) #ifndef QT_NO_IPV6 else if (node->ai_family == AF_INET6) { QHostAddress addr; - addr.setAddress(((sockaddr_in6 *) node->ai_addr)->sin6_addr.s6_addr); + sockaddr_in6 *sa6 = (sockaddr_in6 *) node->ai_addr; + addr.setAddress(sa6->sin6_addr.s6_addr); + if (sa6->sin6_scope_id) + addr.setScopeId(QString::number(sa6->sin6_scope_id)); if (!addresses.contains(addr)) addresses.append(addr); } |