Skip to content

Commit

Permalink
LWIP::get_ipv6_addr fixed to avoid returning NULL even if only linklo…
Browse files Browse the repository at this point in the history
…cal adress exits.
  • Loading branch information
tymoteuszblochmobica committed Oct 18, 2019
1 parent 9c82706 commit 1963d21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions features/lwipstack/lwip_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ const ip_addr_t *LWIP::get_ipv6_addr(const struct netif *netif)
return netif_ip_addr6(netif, i);
}
}

for (int i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) {
return netif_ip_addr6(netif, i);
}
}
#endif
return NULL;
}
Expand Down

0 comments on commit 1963d21

Please sign in to comment.