Skip to content

Commit

Permalink
Merge branch 'bugfix/esp_netif_get_ip6addr_should_be_valid' into 'mas…
Browse files Browse the repository at this point in the history
…ter'

fix(esp_netif): netif should return only valid addr

See merge request espressif/esp-idf!31880
  • Loading branch information
zwx1995esp committed Jul 9, 2024
2 parents c965c92 + 64aa5db commit 3c9cd35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/esp_netif/lwip/esp_netif_lwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 3c9cd35

Please sign in to comment.