mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-18 14:16:55 +08:00
nd6: add nd6_clear_destination_cache() function
The new function, while currently not used internally, allows external code to clear the ND destination cache in the case that it may have become inconsistent with the current situation, for example as the result of a change of locally assigned addresses, or a change in routing tables implemented through the LWIP_HOOK_ND6_GET_GW hook.
This commit is contained in:
committed by
sg
parent
d4fad5929c
commit
cee59ba8cd
@@ -1293,6 +1293,22 @@ nd6_new_destination_cache_entry(void)
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the destination cache.
|
||||
*
|
||||
* This operation may be necessary for consistency in the light of changing
|
||||
* local addresses and/or use of the gateway hook.
|
||||
*/
|
||||
void
|
||||
nd6_clear_destination_cache(void)
|
||||
{
|
||||
s8_t i;
|
||||
|
||||
for (i = 0; i < LWIP_ND6_NUM_DESTINATIONS; i++) {
|
||||
ip6_addr_set_any(&destination_cache[i].destination_addr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether an address matches an on-link prefix.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user