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:
parent
6444756b3c
commit
48b9d735f2
@ -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
|
||||
|
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user