From f25f212027294e5107fc9938e67d31879c171088 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 15 Jun 2013 09:10:46 -0700 Subject: [PATCH] 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 --- src/osd/OSDMap.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 -- 2.39.5