]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: fix is_blacklisted()
authorSage Weil <sage@inktank.com>
Sat, 15 Jun 2013 16:10:46 +0000 (09:10 -0700)
committerSage Weil <sage@inktank.com>
Sun, 16 Jun 2013 03:47:39 +0000 (20:47 -0700)
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 <sage@inktank.com>
src/osd/OSDMap.cc

index cc7646b495bf41d1ea8eb1f6d63f4ea729550f07..711997782a8e1c5207a3a49cf4f0019a6f627f95 100644 (file)
@@ -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<pair<entity_addr_t,utime_t> > *bl) const