mirror of
https://github.com/xcat2/confluent.git
synced 2026-04-13 04:11:31 +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:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user