diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-09-05 03:30:57 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-09-05 03:30:57 +0000 |
commit | b0e07f5e9c393876940b3a22e888d702496258d8 (patch) | |
tree | 9455364f68ffede45ff2e5ce0786436da8923f62 /src/dns.cpp | |
parent | a7c5efea4aea64d0a9165cb30a21781f08619c9a (diff) |
Fixed IPv6 resolving on big-endian machines (bug #403). Patch by Stric.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8019 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dns.cpp')
-rw-r--r-- | src/dns.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/dns.cpp b/src/dns.cpp index 612a47260..c8e465de8 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -721,15 +721,7 @@ DNSResult DNS::GetResult(int resultnum) case DNS_QUERY_AAAA: { - snprintf(formatted,40,"%x:%x:%x:%x:%x:%x:%x:%x", - (ntohs(data.first[0]) + ntohs(data.first[1] << 8)), - (ntohs(data.first[2]) + ntohs(data.first[3] << 8)), - (ntohs(data.first[4]) + ntohs(data.first[5] << 8)), - (ntohs(data.first[6]) + ntohs(data.first[7] << 8)), - (ntohs(data.first[8]) + ntohs(data.first[9] << 8)), - (ntohs(data.first[10]) + ntohs(data.first[11] << 8)), - (ntohs(data.first[12]) + ntohs(data.first[13] << 8)), - (ntohs(data.first[14]) + ntohs(data.first[15] << 8))); + inet_ntop(AF_INET6, data.first, formatted, sizeof(formatted)); char* c = strstr(formatted,":0:"); if (c != NULL) { |