From f4f5b4d1b6869b783af722d601e7c285d036d7d3 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 29 Aug 2024 08:57:39 -0400 Subject: [PATCH] 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. --- confluent_server/confluent/discovery/protocols/pxe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index 5e5c98d4..64e64c79 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -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])