2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Skip peer probe on remote

When remote ip is detected,
communicate by returning False
instead of None.

Use this indication to let ssdp
skip a transmit and growing
pending list in such a case.
This commit is contained in:
Jarrod Johnson 2022-09-06 16:40:34 -04:00
parent 596fcb0f4c
commit 60cfa1d3c5
2 changed files with 7 additions and 1 deletions

View File

@ -189,6 +189,10 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None):
continue
recent_peers.add(peer)
mac = neighutil.get_hwaddr(peer[0])
if mac == False:
# neighutil determined peer ip is not local, skip attempt
# to probe and critically, skip growing deferrednotifiers
continue
if not mac:
probepeer = (peer[0], struct.unpack('H', os.urandom(2))[0] | 1025) + peer[2:]
try:

View File

@ -97,7 +97,9 @@ def get_hwaddr(ipaddr):
_update_neigh()
updated = True
hwaddr = neightable.get(ipaddr, None)
if not hwaddr and not updated and netutil.ip_is_local(ipaddr):
if not hwaddr and not netutil.ip_is_local(ipaddr):
hwaddr = False
if hwaddr == None and not updated:
_update_neigh()
hwaddr = neightable.get(ipaddr, None)
if hwaddr: