From a9b2b55b6027a11866a776744d6f2f9501f9d1de Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 17 May 2015 12:37:18 +0100 Subject: Encase the IPv6 address in `STATS p` with square brackets. This is a widely used format as without it the port is ambigious. --- src/coremods/core_stats.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index 180ece9b3..9fb232bc0 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -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"); -- cgit v1.2.3