From 17b8000c0fa6656e6fbeb566b11899782fa90027 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 28 May 2020 16:49:59 -0400 Subject: [PATCH] Fix ethernet support In accomodating the 20 byte IB hwaddr, it could no longer accept the 6 byte. Adapt to all destination addresses up to 20. --- confluent_server/confluent/discovery/protocols/pxe.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index 49e78d74..10d22b73 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -537,7 +537,9 @@ def send_raw_packet(repview, replen, reqview, info): targ = sockaddr_ll() bcastaddr = get_bcastaddr(ifidx) hwlen = len(bcastaddr) - targ.sll_addr = (ctypes.c_ubyte * 20).from_buffer(bcastaddr) + bcastaddr20 = bytearray(20) + bcastaddr20[:hwlen] = bcastaddr + targ.sll_addr = (ctypes.c_ubyte * 20).from_buffer(bcastaddr20) targ.sll_family = socket.AF_PACKET targ.sll_halen = hwlen targ.sll_protocol = socket.htons(0x800)