From c9157b90eb3d24398310470c3be3635fb4ea385f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 5 Mar 2021 13:14:41 -0500 Subject: [PATCH] Close other places that may be false negative Have checks for neightable be preceeded by an attempt to refresh, to mitigate false negatives. --- confluent_server/confluent/discovery/protocols/slp.py | 2 ++ confluent_server/confluent/discovery/protocols/ssdp.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/confluent_server/confluent/discovery/protocols/slp.py b/confluent_server/confluent/discovery/protocols/slp.py index 61573039..8542465b 100644 --- a/confluent_server/confluent/discovery/protocols/slp.py +++ b/confluent_server/confluent/discovery/protocols/slp.py @@ -535,6 +535,8 @@ def active_scan(handler, protocol=None): for scanned in scan(): for addr in scanned['addresses']: ip = addr[0].partition('%')[0] # discard scope if present + if ip not in neighutil.neightable: + neighutil.update_neigh() if ip not in neighutil.neightable: continue if addr in known_peers: diff --git a/confluent_server/confluent/discovery/protocols/ssdp.py b/confluent_server/confluent/discovery/protocols/ssdp.py index 456fb1c4..c14b9b77 100644 --- a/confluent_server/confluent/discovery/protocols/ssdp.py +++ b/confluent_server/confluent/discovery/protocols/ssdp.py @@ -62,6 +62,8 @@ def active_scan(handler, protocol=None): for scanned in scan(['urn:dmtf-org:service:redfish-rest:1']): for addr in scanned['addresses']: ip = addr[0].partition('%')[0] # discard scope if present + if ip not in neighutil.neightable: + neighutil.update_neigh() if ip not in neighutil.neightable: continue if addr in known_peers: @@ -311,6 +313,8 @@ def _parse_ssdp(peer, rsp, peerdata): ip = peer[0].partition('%')[0] nid = ip mac = None + if ip not in neighutil.neightable: + neighutil.update_neigh() if ip in neighutil.neightable: nid = neighutil.neightable[ip] mac = nid