diff options
Diffstat (limited to 'src/network/kernel/qnetworkinterface_win.cpp')
-rw-r--r-- | src/network/kernel/qnetworkinterface_win.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp index f2bb172..5224fd2 100644 --- a/src/network/kernel/qnetworkinterface_win.cpp +++ b/src/network/kernel/qnetworkinterface_win.cpp @@ -82,9 +82,12 @@ static QHostAddress addressFromSockaddr(sockaddr *sa) if (sa->sa_family == AF_INET) address.setAddress(htonl(((sockaddr_in *)sa)->sin_addr.s_addr)); - else if (sa->sa_family == AF_INET6) + else if (sa->sa_family == AF_INET6) { address.setAddress(((qt_sockaddr_in6 *)sa)->sin6_addr.qt_s6_addr); - else + int scope = ((qt_sockaddr_in6 *)sa)->sin6_scope_id; + if (scope) + address.setScopeId(QString::number(scope)); + } else qWarning("Got unknown socket family %d", sa->sa_family); return address; |