From d43fc12306c7e47ffe0edcf289a8bfc853e0d4bd Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Sun, 28 Aug 2022 03:40:59 -0400 Subject: [PATCH] Advance the xid after we consume a DHCPACK or DHCPNAK. This isn't strictly required by the RFC but it is good practice. --- state.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/state.c b/state.c index 7c6d586..91d428f 100644 --- a/state.c +++ b/state.c @@ -223,6 +223,7 @@ static int extend_packet(struct client_state_t *cs, clibuf, sizeof clibuf); log_line("%s: Server is now offering IP %s. Validating...", client_config.interface, clibuf); + cs->xid = nk_random_u32(&cs->rnd_state); return ANP_CHECK_IP; } else { log_line("%s: Lease refreshed to %u seconds.", @@ -231,6 +232,7 @@ static int extend_packet(struct client_state_t *cs, log_line("%s: Failed to create ARP defense socket.", client_config.interface); stop_dhcp_listen(cs); + cs->xid = nk_random_u32(&cs->rnd_state); return ANP_SUCCESS; } } else if (msgtype == DHCPNAK) {