From: Hao Xiong Date: Sun, 17 Nov 2019 05:41:04 +0000 (+0800) Subject: remove the restriction of address type in init_with_hosts when build initial monmap X-Git-Tag: v15.1.0~772^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c2da4b21a4df379f580472dc418809eb7622ee0;p=ceph.git remove the restriction of address type in init_with_hosts when build initial monmap Signed-off-by: Hao Xiong --- 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); } }