summaryrefslogtreecommitdiff
path: root/util/hostandport.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2010-05-13 17:20:12 -0400
committerMathias Stearn <mathias@10gen.com>2010-05-13 17:22:27 -0400
commitd4292887237e29bdfad87e22713f273c3de9ab70 (patch)
tree358d7aac3a5e53c8c986d1d1ae009c9e2bf3c975 /util/hostandport.h
parentd0aa6b1cb1cf78a4fcdc4a8ef56c6d34ca9bad7e (diff)
downloadmongo-d4292887237e29bdfad87e22713f273c3de9ab70.tar.gz
IPv6 support for HostAndPort SERVER-1114
Diffstat (limited to 'util/hostandport.h')
-rw-r--r--util/hostandport.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/hostandport.h b/util/hostandport.h
index 2db8c375ea3..e0b384c742e 100644
--- a/util/hostandport.h
+++ b/util/hostandport.h
@@ -40,7 +40,7 @@ namespace mongo {
static HostAndPort fromString(string s) {
const char *p = s.c_str();
uassert(13110, "HostAndPort: bad config string", *p);
- const char *colon = strchr(p, ':');
+ const char *colon = strrchr(p, ':');
HostAndPort m;
if( colon ) {
int port = atoi(colon+1);
@@ -98,7 +98,7 @@ namespace mongo {
}
inline bool HostAndPort::isLocalHost() const {
- return _host == "localhost" || _host == "127.0.0.1";
+ return _host == "localhost" || _host == "127.0.0.1" || _host == "::1";
}
}