diff options
author | Sage Weil <sage@inktank.com> | 2013-06-15 09:10:46 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-15 20:47:39 -0700 |
commit | f25f212027294e5107fc9938e67d31879c171088 (patch) | |
tree | 0fcaf3c29c35da375f22971baf9e13f9f41129aa | |
parent | 9253cd8174ca7690414923259b01c0a484323f19 (diff) | |
download | ceph-f25f212027294e5107fc9938e67d31879c171088.tar.gz |
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 <sage@inktank.com>
-rw-r--r-- | src/osd/OSDMap.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index cc7646b495b..711997782a8 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<pair<entity_addr_t,utime_t> > *bl) const |