From 994a4772ca1864589fd2be2f46c7a8bfbdea5b2f Mon Sep 17 00:00:00 2001 From: Vincent van der Locht Date: Sun, 25 Nov 2018 23:44:56 +0100 Subject: [PATCH] net: dhcpv4: net_dhcpv4_stop() removing address during renew In case "net_dhcpv4_stop(..) is called when the interface is in NET_DHCPV4_RENEWING state, the address is not removed. When deleting the address in the NET_DHCPV4_RENEWING state means the status is always equal to the moment before _start is called. Signed-off-by: Vincent van der Locht --- subsys/net/ip/dhcpv4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/ip/dhcpv4.c b/subsys/net/ip/dhcpv4.c index e08519c5c7c..ce29ca8b7fe 100644 --- a/subsys/net/ip/dhcpv4.c +++ b/subsys/net/ip/dhcpv4.c @@ -1107,6 +1107,7 @@ void net_dhcpv4_stop(struct net_if *iface) case NET_DHCPV4_DISABLED: break; + case NET_DHCPV4_RENEWING: case NET_DHCPV4_BOUND: if (!net_if_ipv4_addr_rm(iface, &iface->config.dhcpv4.requested_ip)) { @@ -1117,7 +1118,6 @@ void net_dhcpv4_stop(struct net_if *iface) case NET_DHCPV4_INIT: case NET_DHCPV4_SELECTING: case NET_DHCPV4_REQUESTING: - case NET_DHCPV4_RENEWING: case NET_DHCPV4_REBINDING: iface->config.dhcpv4.state = NET_DHCPV4_DISABLED; NET_DBG("state=%s",