diff options
author | Adam Cooper <adam.cooper@mongodb.com> | 2018-06-11 17:35:51 -0400 |
---|---|---|
committer | Adam Cooper <adam.cooper@mongodb.com> | 2018-06-11 17:35:51 -0400 |
commit | 84ccd279f2910a73b10678685b2a6a90bb6dd8fb (patch) | |
tree | 259e5e3154fa2c5a81a15e81248c873374a32c3e /src/mongo/db/repl | |
parent | 5e7ad8a40626fa24574e4a2b17f810812f288ec8 (diff) | |
download | mongo-84ccd279f2910a73b10678685b2a6a90bb6dd8fb.tar.gz |
SERVER-35101 Strip trailing and leading whitespace from bind_ip arguments and change to
std::vector internally
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/isself.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/repl/repl_set_commands.cpp | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/mongo/db/repl/isself.cpp b/src/mongo/db/repl/isself.cpp index 2d32cfc0b8e..8b7f8daa751 100644 --- a/src/mongo/db/repl/isself.cpp +++ b/src/mongo/db/repl/isself.cpp @@ -161,11 +161,7 @@ bool isSelf(const HostAndPort& hostAndPort, ServiceContext* const ctx) { // of the interfaces on this machine. // No need for ip match if the ports do not match if (hostAndPort.port() == serverGlobalParams.port) { - std::vector<std::string> myAddrs; - - if (!serverGlobalParams.bind_ip.empty()) { - boost::split(myAddrs, serverGlobalParams.bind_ip, boost::is_any_of(", ")); - } + std::vector<std::string> myAddrs = serverGlobalParams.bind_ips; // If any of the bound addresses is the default route (0.0.0.0 on IPv4) it means we are // listening on all network interfaces and need to check against any of them. diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp index 6b2877cacb7..103612358d2 100644 --- a/src/mongo/db/repl/repl_set_commands.cpp +++ b/src/mongo/db/repl/repl_set_commands.cpp @@ -199,15 +199,11 @@ private: namespace { HostAndPort someHostAndPortForMe() { - const auto& bind_ip = serverGlobalParams.bind_ip; + const auto& addrs = serverGlobalParams.bind_ips; const auto& bind_port = serverGlobalParams.port; const auto& af = IPv6Enabled() ? AF_UNSPEC : AF_INET; bool localhost_only = true; - std::vector<std::string> addrs; - if (!bind_ip.empty()) { - boost::split(addrs, bind_ip, boost::is_any_of(","), boost::token_compress_on); - } for (const auto& addr : addrs) { // Get all addresses associated with each named bind host. // If we find any that are valid external identifiers, |