diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-08-09 21:56:26 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-08-22 22:26:50 +0000 |
commit | b626a5859abef9a1b47ba02ffab0fd8d08f79a21 (patch) | |
tree | 003067761813577311d306e82e1865d235a5eaf9 /src/network/kernel/qhostinfo_win.cpp | |
parent | 452924c6ffc9624062bfb83eda8499044cc4719f (diff) |
Remove vestiges of Qt's own sockaddr_in6 and sockaddr_storage
We weren't using qt_sockaddr_storage, so it's not a problem. But since
we're not using it anyway, we don't really need it. The storage is only
needed if we needed to get a bigger socket address and that only happens
with Unix sockets (paths).
sockaddr_in6, however, was just wrong. Some systems derived from BSD,
like OS X, have a sXX_len field containing the length of the socket
address structure and our qt_sockaddr_in6 was missing sin6_len. As a
result, setting sin6_family was just plain wrong on little-endian
systems. Like all modern systems running BSDs and OS X...
Change-Id: I7de033f80b0e4431b7f1ffff13f900f004c55443
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/kernel/qhostinfo_win.cpp')
-rw-r--r-- | src/network/kernel/qhostinfo_win.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index fc65ce9fa2..da28cd48c1 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -136,7 +136,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) // Reverse lookup if (local_getnameinfo) { sockaddr_in sa4; - qt_sockaddr_in6 sa6; + sockaddr_in6 sa6; sockaddr *sa; QT_SOCKLEN_T saSize; if (address.protocol() == QAbstractSocket::IPv4Protocol) { @@ -150,7 +150,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) saSize = sizeof(sa6); memset(&sa6, 0, sizeof(sa6)); sa6.sin6_family = AF_INET6; - memcpy(sa6.sin6_addr.qt_s6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr.qt_s6_addr)); + memcpy(&sa6.sin6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr)); } char hbuf[NI_MAXHOST]; @@ -197,7 +197,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) break; case AF_INET6: { QHostAddress addr; - addr.setAddress(((qt_sockaddr_in6 *) p->ai_addr)->sin6_addr.qt_s6_addr); + addr.setAddress(((sockaddr_in6 *) p->ai_addr)->sin6_addr.s6_addr); if (!addresses.contains(addr)) addresses.append(addr); } |