2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 02:52:07 +00:00

Suppress bad gateway warning if the client ip is unknown

In a scenario where we are doing the 'next-server' next to a real dhcp server,
but through relay, the missing gateway would be expected.

Rely on the final message about 'no address' as the clue to users
that something went wrong on the node side.
This commit is contained in:
Jarrod Johnson 2024-08-29 08:57:39 -04:00
parent fd301c609f
commit f4f5b4d1b6

View File

@ -856,7 +856,7 @@ def reply_dhcp4(node, info, packet, cfg, reqview, httpboot, cfd, profile, sock=N
repview[replen - 1:replen + 1] = b'\x03\x04'
repview[replen + 1:replen + 5] = gateway
replen += 6
elif relayip != b'\x00\x00\x00\x00':
elif relayip != b'\x00\x00\x00\x00' and clipn:
log.log({'error': 'Relay DHCP offer to {} will fail due to missing gateway information'.format(node)})
if 82 in packet:
reloptionslen = len(packet[82])