From 0c2da4b21a4df379f580472dc418809eb7622ee0 Mon Sep 17 00:00:00 2001 From: Hao Xiong Date: Sun, 17 Nov 2019 13:41:04 +0800 Subject: [PATCH] remove the restriction of address type in init_with_hosts when build initial monmap Signed-off-by: Hao Xiong --- src/mon/MonMap.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc index d63bada0fd6..d35f20eb282 100644 --- a/src/mon/MonMap.cc +++ b/src/mon/MonMap.cc @@ -503,7 +503,7 @@ int MonMap::init_with_hosts(const std::string& hostlist, vector addrs; bool success = parse_ip_port_vec( hosts, addrs, - for_mkfs ? entity_addr_t::TYPE_MSGR2 : entity_addr_t::TYPE_ANY); + entity_addr_t::TYPE_ANY); free(hosts); if (!success) return -EINVAL; @@ -516,8 +516,10 @@ int MonMap::init_with_hosts(const std::string& hostlist, string name = prefix; name += n; if (addrs[i].v.size() == 1) { - _add_ambiguous_addr(name, addrs[i].front(), 0, 0, false); + _add_ambiguous_addr(name, addrs[i].front(), 0, 0, for_mkfs); } else { + // they specified an addrvec, so let's assume they also specified + // the addr *type* and *port*. (we could possibly improve this?) add(name, addrs[i], 0); } } -- 2.47.3