From c21ae64f061d921022b0cb617be622f3c90e2787 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 20 Apr 2020 12:45:13 -0400 Subject: [PATCH] Fix PXE with static gateway It was not working when gateway was set. --- confluent_server/confluent/discovery/protocols/pxe.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index f4448599..b0918bc2 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -452,6 +452,8 @@ def check_reply(node, info, packet, sock, cfg, reqview): clipn = socket.inet_aton(niccfg['ipv4_address']) repview[16:20] = clipn gateway = niccfg['ipv4_gateway'] + if gateway: + gateway = socket.inet_aton(gateway) netmask = niccfg['prefix'] netmask = (2**32 - 1) ^ (2**(32 - netmask) - 1) netmask = struct.pack('!I', netmask)