Do not assume that because at least one OSD has an hb_front addr that they
all do, or else we will end up assigning garbage here and later thinking
it is a addr (or, more precisely, != entity_addr_t()).
Fixes: #5460
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
else
osd_addrs->hb_back_addr[i->first].reset(
new entity_addr_t(inc.new_hb_back_up.find(i->first)->second));
- if (!inc.new_hb_front_up.empty())
- osd_addrs->hb_front_addr[i->first].reset(
- new entity_addr_t(inc.new_hb_front_up.find(i->first)->second));
+ map<int32_t,entity_addr_t>::const_iterator j = inc.new_hb_front_up.find(i->first);
+ if (j != inc.new_hb_front_up.end())
+ osd_addrs->hb_front_addr[i->first].reset(new entity_addr_t(j->second));
else
osd_addrs->hb_front_addr[i->first].reset();