Skip to content

Commit 2a5b891

Browse files
rlubosnashif
authored andcommitted
net: dhcpv4: client: Do not generate new xid for Request message
According to RFC 2131, DHCP clients should use the same xid as received in the Offer message when sending DHCP Requests. Therefore, when generating DHCP Request message, the xid value should not be incremented. One vague topic is whether the xid value should be updated when sending Requests from Renewing or Rebinding states, however RFC makes no exception for those states, and other implementations (dhclient, lwip) seem to reuse the same xid in such cases, so comply with this behavior. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 45a1cf7)
1 parent db8c098 commit 2a5b891

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

subsys/net/lib/dhcpv4/dhcpv4.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,6 @@ static uint32_t dhcpv4_send_request(struct net_if *iface)
544544
struct net_pkt *pkt = NULL;
545545
uint32_t timeout = UINT32_MAX;
546546

547-
iface->config.dhcpv4.xid++;
548-
549547
switch (iface->config.dhcpv4.state) {
550548
case NET_DHCPV4_DISABLED:
551549
case NET_DHCPV4_INIT:

0 commit comments

Comments
 (0)