From: Sage Weil Date: Sat, 15 Jun 2013 16:10:46 +0000 (-0700) Subject: osd/OSDMap: fix is_blacklisted() X-Git-Tag: v0.65~59 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f25f212027294e5107fc9938e67d31879c171088;p=ceph.git osd/OSDMap: fix is_blacklisted() You can only call set_port() if is_ip() is true (there is an assert in the accessor). Fixes: #5366 Signed-off-by: Sage Weil --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index cc7646b495bf4..711997782a8e1 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -609,10 +609,16 @@ bool OSDMap::is_blacklisted(const entity_addr_t& a) const return true; // is entire ip blacklisted? - entity_addr_t b = a; - b.set_port(0); - b.set_nonce(0); - return blacklist.count(b); + if (a.is_ip()) { + entity_addr_t b = a; + b.set_port(0); + b.set_nonce(0); + if (blacklist.count(b)) { + return true; + } + } + + return false; } void OSDMap::get_blacklist(list > *bl) const