Skip to content

Commit a025a65

Browse files
JordanYatesMaureenHelm
authored andcommitted
net: lib: dhcpv4: goto INIT on IF down, not RENEWING
When the interface goes down, the safest thing to do is to return to the INIT state, as there is no guarantee that any state is preserved upon the interface coming back up again. This is particularly the case with WiFi. Signed-off-by: Jordan Yates <[email protected]> (cherry picked from commit 0f56974)
1 parent ace6e44 commit a025a65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/lib/dhcpv4/dhcpv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ static void dhcpv4_iface_event_handler(struct net_mgmt_event_callback *cb,
11601160

11611161
if (iface->config.dhcpv4.state == NET_DHCPV4_BOUND) {
11621162
iface->config.dhcpv4.attempts = 0U;
1163-
iface->config.dhcpv4.state = NET_DHCPV4_RENEWING;
1163+
iface->config.dhcpv4.state = NET_DHCPV4_INIT;
11641164
NET_DBG("enter state=%s", net_dhcpv4_state_name(
11651165
iface->config.dhcpv4.state));
11661166
/* Remove any bound address as interface is gone */

0 commit comments

Comments
 (0)