Commit 45a1cf7f authored by Robert Lubos's avatar Robert Lubos Committed by Benjamin Cabé
Browse files

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: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 9d544655
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -545,8 +545,6 @@ static uint32_t dhcpv4_send_request(struct net_if *iface)
	struct net_pkt *pkt = NULL;
	uint32_t timeout = UINT32_MAX;

	iface->config.dhcpv4.xid++;

	switch (iface->config.dhcpv4.state) {
	case NET_DHCPV4_DISABLED:
	case NET_DHCPV4_INIT: