Skip to content

Commit 61c49cc

Browse files
committed
Merge branch 'revert-a7dbe5ec' into 'release/v3.1'
Revert "Merge branch 'bugfix/fix_addr_changed_when_wifi_disconnect_v3.1' into 'release/v3.1'" See merge request sdk/ESP8266_RTOS_SDK!1385
2 parents c2ed227 + eaf7f73 commit 61c49cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/tcpip_adapter/tcpip_adapter_lwip.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ esp_err_t tcpip_adapter_up(tcpip_adapter_if_t tcpip_if)
434434
}
435435

436436
/* use last obtained ip, or static ip */
437-
esp_netif[tcpip_if]->flags |= NETIF_FLAG_UP;
437+
netif_set_addr(esp_netif[tcpip_if], &esp_ip[tcpip_if].ip, &esp_ip[tcpip_if].netmask, &esp_ip[tcpip_if].gw);
438+
netif_set_up(esp_netif[tcpip_if]);
438439
}
439440

440441
tcpip_adapter_update_default_netif();
@@ -465,7 +466,9 @@ esp_err_t tcpip_adapter_down(tcpip_adapter_if_t tcpip_if)
465466
tcpip_adapter_reset_ip_info(tcpip_if);
466467
}
467468

468-
esp_netif[tcpip_if]->flags &= ~NETIF_FLAG_UP;
469+
netif_set_addr(esp_netif[tcpip_if], IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
470+
netif_set_down(esp_netif[tcpip_if]);
471+
tcpip_adapter_start_ip_lost_timer(tcpip_if);
469472
}
470473

471474
tcpip_adapter_update_default_netif();

0 commit comments

Comments
 (0)