mirror of https://github.com/ARMmbed/mbed-os.git
LWIP::get_ipv6_addr fixed to avoid returning NULL even if only linklocal adress exits.
parent
ce2800b01d
commit
1097ba7bda
|
@ -228,7 +228,13 @@ void LWIP::Interface::netif_status_irq(struct netif *netif)
|
|||
|
||||
if (interface->has_addr_state & HAS_ANY_ADDR) {
|
||||
interface->connected = NSAPI_STATUS_GLOBAL_UP;
|
||||
#if LWIP_IPV6
|
||||
if (ip_addr_islinklocal(get_ipv6_addr(netif))) {
|
||||
interface->connected = NSAPI_STATUS_LOCAL_UP;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} else if (!netif_is_up(&interface->netif) && netif_is_link_up(&interface->netif)) {
|
||||
interface->connected = NSAPI_STATUS_DISCONNECTED;
|
||||
}
|
||||
|
|
|
@ -92,6 +92,12 @@ const ip_addr_t *LWIP::get_ipv6_link_local_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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue