From: Adam Date: Mon, 8 Sep 2014 22:27:57 +0000 (-0400) Subject: Remove IPv6 address compaction. X-Git-Tag: v2.0.23~147 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=635cf9590b116eed03f38fc44bcdb96665f81f22;p=user%2Fhenk%2Fcode%2Finspircd.git Remove IPv6 address compaction. This code is incorrect and can produce addresses with multiple double colons. No other IRCds do this and most systems today will give us the compact version anyway. Issue #914 --- diff --git a/src/dns.cpp b/src/dns.cpp index 8ad94e9e1..977f4bad0 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -678,18 +678,6 @@ DNSResult DNS::GetResult() case DNS_QUERY_AAAA: { inet_ntop(AF_INET6, data.first, formatted, sizeof(formatted)); - char* c = strstr(formatted,":0:"); - if (c != NULL) - { - memmove(c+1,c+2,strlen(c+2) + 1); - c += 2; - while (memcmp(c,"0:",2) == 0) - memmove(c,c+2,strlen(c+2) + 1); - if (memcmp(c,"0",2) == 0) - *c = 0; - if (memcmp(formatted,"0::",3) == 0) - memmove(formatted,formatted + 1, strlen(formatted + 1) + 1); - } resultstr = formatted; /* Special case. Sending ::1 around between servers