mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/esp_netif_get_ip6addr_should_be_valid' into 'master'
fix(esp_netif): netif should return only valid addr See merge request espressif/esp-idf!31880
This commit is contained in:
commit
3c9cd354ec
@ -2265,7 +2265,7 @@ int esp_netif_get_all_ip6(esp_netif_t *esp_netif, esp_ip6_addr_t if_ip6[])
|
||||
|
||||
if (p_netif != NULL && netif_is_up(p_netif)) {
|
||||
for (int i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
|
||||
if (!ip_addr_cmp(&p_netif->ip6_addr[i], IP6_ADDR_ANY)) {
|
||||
if (ip6_addr_isvalid(netif_ip6_addr_state(p_netif, i)) && !ip_addr_cmp(&p_netif->ip6_addr[i], IP6_ADDR_ANY)) {
|
||||
memcpy(&if_ip6[addr_count++], &p_netif->ip6_addr[i], sizeof(ip6_addr_t));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user