2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-25 12:41:39 +00:00

Fix PXE with static gateway

It was not working when gateway was set.
This commit is contained in:
Jarrod Johnson 2020-04-20 12:45:13 -04:00
parent eb2301b22e
commit c21ae64f06

View File

@ -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)