]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dns.cpp
Add 'no such server' on remote stats to invalid name
[user/henk/code/inspircd.git] / src / dns.cpp
index 0a22b28d8780d40995143a43ef948903c7a3197a..0436095b6bd30afc315837138fd0f7402a4c1891 100644 (file)
@@ -645,6 +645,14 @@ DNSResult DNS::GetResult()
                                                memmove(formatted,formatted + 1, strlen(formatted + 1) + 1);
                                }
                                resultstr = formatted;
+
+                               /* Special case. Sending ::1 around between servers
+                                * and to clients is dangerous, because the : on the
+                                * start makes the client or server interpret the IP
+                                * as the last parameter on the line with a value ":1".
+                                */
+                               if (*formatted == ':')
+                                       resultstr = "0" + resultstr;
                        }
                        break;