diff options
author | Mathias Stearn <mathias@10gen.com> | 2010-07-29 15:33:29 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2010-07-29 16:33:42 -0400 |
commit | be9891dd18abbe1c6ed0d59ac514022ef04eb2fe (patch) | |
tree | fd59b54fe3c641a53bcb2c77004aa6773139e9b6 /util | |
parent | 0aecc0bfd34ff9a9f7fae568555723781b1ea429 (diff) | |
download | mongo-be9891dd18abbe1c6ed0d59ac514022ef04eb2fe.tar.gz |
Treat whole 127 subnet as localhost
Diffstat (limited to 'util')
-rw-r--r-- | util/hostandport.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/hostandport.h b/util/hostandport.h index 7c0828be638..d6b8242c241 100644 --- a/util/hostandport.h +++ b/util/hostandport.h @@ -124,7 +124,7 @@ namespace mongo { } inline bool HostAndPort::isLocalHost() const { - return _host == "localhost" || _host == "127.0.0.1" || _host == "::1"; + return _host == "localhost" || startsWith(_host.c_str(), "127.") || _host == "::1"; } inline HostAndPort::HostAndPort(string s) { |