From: Sage Weil Date: Fri, 18 May 2012 01:17:18 +0000 (-0700) Subject: mon: simplify/clean up dummy addrs used for initial members X-Git-Tag: v0.48argonaut~137^2~13^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6551298fe1cd48fac55baf3c0f8f267dd0ce8f63;p=ceph.git mon: simplify/clean up dummy addrs used for initial members Use a complete blank IP, but set the nonce. This way entity_addr_t::is_blank_ip() works. We're also outside of the namespace of possible addrs that the mons *could* use, which is a bit cleaner. Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index e64739b2c4bd..fa9c7c5229d7 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -318,7 +318,7 @@ int Monitor::init() entity_addr_t a; a.set_family(AF_INET); for (int n=1; ; n++) { - a.set_port(n); + a.set_nonce(n); if (!monmap->contains(a)) break; } @@ -705,12 +705,7 @@ void Monitor::handle_probe_reply(MMonProbe *m) // new initial peer? if (monmap->contains(m->name)) { - entity_addr_t a = monmap->get_addr(m->name); - a.set_port(0); - entity_addr_t b; - b.set_family(AF_INET); - dout(1) << " a " << a <<" b " << b << dendl; - if (a == b) { + if (monmap->get_addr(m->name).is_blank_ip()) { dout(1) << " learned initial mon " << m->name << " addr " << m->get_source_addr() << dendl; monmap->set_addr(m->name, m->get_source_addr()); m->put();