mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-17 23:27:06 +08:00
Merge branch 'bugfix/fix_addr_changed_when_wifi_disconnect_v3.1' into 'release/v3.1'
fix(tcpip_adapter): fix local IP changed when Wi-Fi disconnect (backport v3.1) See merge request sdk/ESP8266_RTOS_SDK!1375
This commit is contained in:
@ -434,8 +434,7 @@ esp_err_t tcpip_adapter_up(tcpip_adapter_if_t tcpip_if)
|
||||
}
|
||||
|
||||
/* use last obtained ip, or static ip */
|
||||
netif_set_addr(esp_netif[tcpip_if], &esp_ip[tcpip_if].ip, &esp_ip[tcpip_if].netmask, &esp_ip[tcpip_if].gw);
|
||||
netif_set_up(esp_netif[tcpip_if]);
|
||||
esp_netif[tcpip_if]->flags |= NETIF_FLAG_UP;
|
||||
}
|
||||
|
||||
tcpip_adapter_update_default_netif();
|
||||
@ -466,9 +465,7 @@ esp_err_t tcpip_adapter_down(tcpip_adapter_if_t tcpip_if)
|
||||
tcpip_adapter_reset_ip_info(tcpip_if);
|
||||
}
|
||||
|
||||
netif_set_addr(esp_netif[tcpip_if], IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
|
||||
netif_set_down(esp_netif[tcpip_if]);
|
||||
tcpip_adapter_start_ip_lost_timer(tcpip_if);
|
||||
esp_netif[tcpip_if]->flags &= ~NETIF_FLAG_UP;
|
||||
}
|
||||
|
||||
tcpip_adapter_update_default_netif();
|
||||
|
Reference in New Issue
Block a user