2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-09 04:56:12 +00:00

Avoid empty hwaddr

It has been observed, at least once, for an empty hwaddr to appear.
Take measures to prevent this from occurring and making into the
discovery info.
This commit is contained in:
Jarrod Johnson 2018-01-19 10:22:22 -05:00
parent 6444756b3c
commit 48b9d735f2
2 changed files with 2 additions and 2 deletions

View File

@ -510,7 +510,7 @@ def _recheck_single_unknown_info(configmanager, info):
def safe_detected(info):
if 'hwaddr' not in info:
if 'hwaddr' not in info or not info['hwaddr']:
return
if info['hwaddr'] in runningevals:
# Do not evaluate the same mac multiple times at once

View File

@ -92,7 +92,7 @@ def snoop(handler):
rq = bytearray(rq)
if rq[0] == 1: # Boot request
addrlen = rq[2]
if addrlen > 16: # max address size in bootp is 16 bytes
if addrlen > 16 or addrlen == 0:
continue
netaddr = rq[28:28+addrlen]
netaddr = ':'.join(['{0:02x}'.format(x) for x in netaddr])