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

Induce probe by randomized port

Replying to SLP caused some SLP
software to have a bug.

Since we aren't looking for a reply,
instead just throw a byte randomly at a high numbered
port.
This commit is contained in:
Jarrod Johnson 2021-12-14 07:49:09 -05:00
parent faa20660ed
commit e488560090

View File

@ -111,7 +111,8 @@ def _parse_slp_packet(packet, peer, rsps, xidmap, defer=None, sock=None):
if defer is None:
identifier = addr
else:
sock.sendto(b'\x00', peer)
probepeer = (peer[0], struct.unpack('H', os.urandom(2))[0] | 1025) + peer[2:]
sock.sendto(b'\x00', probepeer)
defer.append((packet, peer))
return
if (identifier, parsed['xid']) in rsps:
@ -485,7 +486,8 @@ def snoop(handler, protocol=None):
continue
mac = neighutil.get_hwaddr(peer[0])
if not mac:
s.sendto(b'\x00', peer)
probepeer = (peer[0], struct.unpack('H', os.urandom(2))[0] | 1025) + peer[2:]
s.sendto(b'\x00', probepeer)
deferpeers.append(peer)
continue
process_peer(newmacs, known_peers, peerbymacaddress, peer)