Skip to content

Commit 1963d21

Browse files
LWIP::get_ipv6_addr fixed to avoid returning NULL even if only linklocal adress exits.
1 parent 9c82706 commit 1963d21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

features/lwipstack/lwip_tools.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ const ip_addr_t *LWIP::get_ipv6_addr(const struct netif *netif)
9292
return netif_ip_addr6(netif, i);
9393
}
9494
}
95+
96+
for (int i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
97+
if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) {
98+
return netif_ip_addr6(netif, i);
99+
}
100+
}
95101
#endif
96102
return NULL;
97103
}

0 commit comments

Comments
 (0)