summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-08-18 14:17:55 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-08-24 10:28:36 (GMT)
commitae29cdf5cd319e447ef75b11ac1247375c6c8192 (patch)
tree7090407072c816b755a5bf33edf541cb0c3790de /src/network/kernel
parent409d41185e85f2eefe6bb4872c4dd3005bef8170 (diff)
downloadQt-ae29cdf5cd319e447ef75b11ac1247375c6c8192.zip
Qt-ae29cdf5cd319e447ef75b11ac1247375c6c8192.tar.gz
Qt-ae29cdf5cd319e447ef75b11ac1247375c6c8192.tar.bz2
Keep the scopeid that getaddrinfo(3) returns to us.
Task-number: QTBUG-12608, QTBUG-12243 Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 3112dd6..9e3da61 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -247,7 +247,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);
}