From b0e07f5e9c393876940b3a22e888d702496258d8 Mon Sep 17 00:00:00 2001 From: special Date: Wed, 5 Sep 2007 03:30:57 +0000 Subject: 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 --- src/dns.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3