]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Encase the IPv6 address in `STATS p` with square brackets.
authorPeter Powell <petpow@saberuk.com>
Sun, 17 May 2015 11:37:18 +0000 (12:37 +0100)
committerPeter Powell <petpow@saberuk.com>
Sun, 17 May 2015 11:37:18 +0000 (12:37 +0100)
This is a widely used format as without it the port is ambigious.

src/coremods/core_stats.cpp

index 180ece9b3b1f56ee883bc19aa42d35792524f85d..9fb232bc0192bb7a2e1d0210f1e580a09042df3d 100644 (file)
@@ -99,6 +99,11 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
                                std::string ip = ls->bind_addr;
                                if (ip.empty())
                                        ip.assign("*");
+                               else if (ip.find_first_of(':') != std::string::npos)
+                               {
+                                       ip.insert(ip.begin(), '[');
+                                       ip.insert(ip.end(),  ']');
+                               }
                                std::string type = ls->bind_tag->getString("type", "clients");
                                std::string hook = ls->bind_tag->getString("ssl", "plaintext");