diff options
author | Peter Powell <petpow@saberuk.com> | 2015-05-17 12:37:18 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2015-05-17 12:37:18 +0100 |
commit | a9b2b55b6027a11866a776744d6f2f9501f9d1de (patch) | |
tree | 1030d17a5acc1b2bdd9dd90beb24c76df4445691 | |
parent | 6d5169671560a20cf0ae11300766e6de073f5b7b (diff) |
Encase the IPv6 address in `STATS p` with square brackets.
This is a widely used format as without it the port is ambigious.
-rw-r--r-- | src/coremods/core_stats.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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"); |