Forget addresses set up by SLAAC when prefix expires.

This commit is contained in:
Stian Sebastian Skjelstad 2015-09-02 13:12:52 -06:00 committed by Ivan Delamer
parent aa0e41c389
commit aea87a9a2f

View File

@ -743,11 +743,34 @@ nd6_tmr(void)
/* Process prefix entries. */
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) {
/* Entry timed out, remove it */
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;
#if LWIP_IPV6_AUTOCONFIG
@ -779,6 +802,7 @@ nd6_tmr(void)
#endif /* LWIP_IPV6_AUTOCONFIG */
}
}
}
/* Process our own addresses, if DAD configured. */