2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 04:50:21 +00:00

Close other places that may be false negative

Have checks for neightable be preceeded by an attempt to refresh,
to mitigate false negatives.
This commit is contained in:
Jarrod Johnson 2021-03-05 13:14:41 -05:00
parent e3c17491e5
commit 2e63ff3aca
2 changed files with 6 additions and 0 deletions

View File

@ -542,6 +542,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:

View File

@ -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