From 2cb641e734bfffa54b509856b19d74f2e46a5994 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 28 Apr 2021 15:36:12 -0400 Subject: [PATCH] Fix PXE based on mac We normally use UUID, on a broken platform with bad UUID, user may need to use hwaddr. This was supposed to work, but didn't. Fix it to work correctly. --- confluent_server/confluent/discovery/protocols/pxe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index 7dba1850..625ab99b 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -252,8 +252,9 @@ def proxydhcp(): optidx = rq.index(b'\x63\x82\x53\x63') + 4 except ValueError: continue + hwlen = rq[2] opts, disco = opts_to_dict(rq, optidx, 3) - disco['uuid'] + disco['hwaddr'] = ':'.join(['{0:02x}'.format(x) for x in rq[28:28+hwlen]]) node = None if disco.get('hwaddr', None) in macmap: node = macmap[disco['hwaddr']] @@ -261,7 +262,7 @@ def proxydhcp(): node = uuidmap[disco['uuid']] if not node: continue - hwlen = rq[2] + myipn = myipbypeer.get(rqv[28:28+hwlen].tobytes(), None) if not myipn: continue