mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 23:12:09 +00:00
Forget addresses set up by SLAAC when prefix expires.
This commit is contained in:
parent
aa0e41c389
commit
aea87a9a2f
@ -743,11 +743,34 @@ nd6_tmr(void)
|
|||||||
|
|
||||||
/* Process prefix entries. */
|
/* Process prefix entries. */
|
||||||
for (i = 0; i < LWIP_ND6_NUM_PREFIXES; i++) {
|
for (i = 0; i < LWIP_ND6_NUM_PREFIXES; i++) {
|
||||||
|
if (prefix_list[i].netif != NULL) {
|
||||||
if (prefix_list[i].invalidation_timer < ND6_TMR_INTERVAL / 1000) {
|
if (prefix_list[i].invalidation_timer < ND6_TMR_INTERVAL / 1000) {
|
||||||
|
/* Entry timed out, remove it */
|
||||||
prefix_list[i].invalidation_timer = 0;
|
prefix_list[i].invalidation_timer = 0;
|
||||||
|
|
||||||
|
#if LWIP_IPV6_AUTOCONFIG
|
||||||
|
/* If any addresses were configured with this prefix, remove them */
|
||||||
|
if (prefix_list[i].flags & ND6_PREFIX_AUTOCONFIG_ADDRESS_GENERATED)
|
||||||
|
{
|
||||||
|
s8_t j;
|
||||||
|
|
||||||
|
for (j = 1; j < LWIP_IPV6_NUM_ADDRESSES; j++) {
|
||||||
|
if ((netif_ip6_addr_state(prefix_list[i].netif, j) != IP6_ADDR_INVALID) &&
|
||||||
|
ip6_addr_netcmp(&prefix_list[i].prefix, netif_ip6_addr(prefix_list[i].netif, j))) {
|
||||||
|
netif_ip6_addr_set_state(prefix_list[i].netif, j, IP6_ADDR_INVALID);
|
||||||
|
prefix_list[i].flags = 0;
|
||||||
|
|
||||||
|
/* Exit loop. */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if ((prefix_list[i].invalidation_timer > 0) &&
|
}
|
||||||
(prefix_list[i].netif != NULL)) {
|
}
|
||||||
|
#endif /* LWIP_IPV6_AUTOCONFIG */
|
||||||
|
|
||||||
|
prefix_list[i].netif = NULL;
|
||||||
|
prefix_list[i].flags = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
prefix_list[i].invalidation_timer -= ND6_TMR_INTERVAL / 1000;
|
prefix_list[i].invalidation_timer -= ND6_TMR_INTERVAL / 1000;
|
||||||
|
|
||||||
#if LWIP_IPV6_AUTOCONFIG
|
#if LWIP_IPV6_AUTOCONFIG
|
||||||
@ -779,6 +802,7 @@ nd6_tmr(void)
|
|||||||
#endif /* LWIP_IPV6_AUTOCONFIG */
|
#endif /* LWIP_IPV6_AUTOCONFIG */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Process our own addresses, if DAD configured. */
|
/* Process our own addresses, if DAD configured. */
|
||||||
|
Loading…
Reference in New Issue
Block a user