mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-11 19:49:02 -04:00
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
This commit is contained in:
parent
a7c5efea4a
commit
b0e07f5e9c
10
src/dns.cpp
10
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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user