cms_net.wolmatch: Only send to MAC addresses with valid length

This commit is contained in:
Adam Goldsmith 2022-10-05 14:22:37 -04:00
parent fb88f882a6
commit 22b2c1759a

View File

@ -32,9 +32,9 @@ def wolmatch(tgt, destport=9):
continue
# NOTE: FIVE, NINE, and TEN all should have eth addr as well, why is there only one printed?
for iface, mac in minion['hwaddr_interfaces'].items():
if iface == 'lo' or mac == ':::::':
continue
mac = mac.strip()
if iface == 'lo' or len(mac) != len("00:00:00:00:00:00"):
continue
#print(name, iface, mac, minion['ip_interfaces'])
wol(mac, destport=destport)
log.info('Waking up %s', mac)