Skip to content

Commit 45a1cf7

Browse files
rluboskartben
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 <robert.lubos@nordicsemi.no>
1 parent 9d54465 commit 45a1cf7

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
@@ -545,8 +545,6 @@ static uint32_t dhcpv4_send_request(struct net_if *iface)
545545
struct net_pkt *pkt = NULL;
546546
uint32_t timeout = UINT32_MAX;
547547

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

0 commit comments

Comments
 (0)