mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
lwip/ipv6:ipv6 address get fail after wifi disconnect
This commit is contained in:
parent
2b374ab7b8
commit
91fd587fb7
@ -1208,6 +1208,9 @@ static esp_err_t esp_netif_down_api(esp_netif_api_msg_t *msg)
|
||||
}
|
||||
for(int8_t i = 0 ;i < LWIP_IPV6_NUM_ADDRESSES ;i++) {
|
||||
netif_ip6_addr_set(lwip_netif, i, IP6_ADDR_ANY6);
|
||||
netif_ip6_addr_set_valid_life(lwip_netif, i, 0);
|
||||
netif_ip6_addr_set_pref_life(lwip_netif, i, 0);
|
||||
netif_ip6_addr_set_state(lwip_netif, i, IP6_ADDR_INVALID);
|
||||
}
|
||||
netif_set_addr(lwip_netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
|
||||
netif_set_down(lwip_netif);
|
||||
@ -1556,9 +1559,10 @@ esp_err_t esp_netif_get_ip6_global(esp_netif_t *esp_netif, esp_ip6_addr_t *if_ip
|
||||
|
||||
if (p_netif != NULL && netif_is_up(p_netif)) {
|
||||
for (i = 1; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
|
||||
if (ip6_addr_ispreferred(netif_ip6_addr_state(p_netif, i))) {
|
||||
memcpy(if_ip6, &p_netif->ip6_addr[i], sizeof(ip6_addr_t));
|
||||
return ESP_OK;
|
||||
if (ip6_addr_ispreferred(netif_ip6_addr_state(p_netif, i)) &&
|
||||
ip6_addr_isglobal(netif_ip6_addr(p_netif, i))) {
|
||||
memcpy(if_ip6, &p_netif->ip6_addr[i], sizeof(ip6_addr_t));
|
||||
return ESP_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user