]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove IPv6 address compaction.
authorAdam <Adam@anope.org>
Mon, 8 Sep 2014 22:27:57 +0000 (18:27 -0400)
committerAdam <Adam@anope.org>
Mon, 8 Sep 2014 22:30:24 +0000 (18:30 -0400)
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

src/dns.cpp

index 8ad94e9e1a9fa4465e1ce570b1bf596deb34af8a..977f4bad065846115ee4d45b99208a9153d1881e 100644 (file)
@@ -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