Skip to content

Commit d1378dc

Browse files
author
Arto Kinnunen
authored
Clear IPv6 neighbor cache in partition change (ARMmbed#1554)
Clear IPv6 neighbor cache when moving to new partition in order to avoid stale cache entries in new partition.
1 parent 7610e91 commit d1378dc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/6LoWPAN/Thread/thread_common.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,12 +1922,19 @@ void thread_mcast_group_change(struct protocol_interface_info_entry *interface,
19221922

19231923
void thread_old_partition_data_purge(thread_info_t *thread_info)
19241924
{
1925+
protocol_interface_info_entry_t *cur;
1926+
19251927
/* Partition has been changed. Wipe out data related to old partition */
19261928
thread_management_client_pending_coap_request_kill(thread_info->interface_id);
19271929

1928-
/* Reset/init previous routing information */
1930+
/* Reset previous routing information */
19291931
thread_routing_reset(&thread_info->routing);
1930-
thread_routing_init(&thread_info->routing);
1932+
1933+
/* Clear previous context ID's */
1934+
cur = protocol_stack_interface_info_get_by_id(thread_info->interface_id);
1935+
1936+
/* Flush address cache */
1937+
ipv6_neighbour_cache_flush(&cur->ipv6_neighbour_cache);
19311938
}
19321939

19331940
#endif

0 commit comments

Comments
 (0)