From f28495a58b6bb0262befa909f0664aaac496c1e5 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Wed, 18 Feb 2015 06:01:43 -0500 Subject: [PATCH] selecting_packet() shouldn't take the xid from the packet. This change actually has no effect because incoming dhcp packets that differ from our xid are dropped, so the xid is always changed to the same value that it already has. --- src/state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/state.c b/src/state.c index d3f3cff..ce60b92 100644 --- a/src/state.c +++ b/src/state.c @@ -276,6 +276,9 @@ static int an_packet(struct client_state_t cs[static 1], return ANP_IGNORE; } +// XXX: This should also handle the REQUESTING part of an_packet and +// be used during REQUESTING; that will allow ndhc to track multiple +// DHCPOFFERs. static int selecting_packet(struct client_state_t cs[static 1], struct dhcpmsg packet[static 1], uint8_t msgtype, uint32_t srcaddr) @@ -292,7 +295,6 @@ static int selecting_packet(struct client_state_t cs[static 1], char svrbuf[INET_ADDRSTRLEN]; char srcbuf[INET_ADDRSTRLEN]; cs->serverAddr = sid; - cs->xid = packet->xid; cs->clientAddr = packet->yiaddr; cs->srcAddr = srcaddr; cs->dhcp_wake_ts = curms();