Skip to content

Commit 912cf02

Browse files
purge old partition data when child id response is received (#1588)
1 parent 648ef89 commit 912cf02

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

source/6LoWPAN/Thread/thread_host_bootstrap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,10 @@ static void thread_merge_prepare(protocol_interface_info_entry_t *cur)
121121
{
122122
thread_clean_old_16_bit_address_based_addresses(cur);
123123
mpl_clear_realm_scope_seeds(cur);
124-
ipv6_neighbour_cache_flush(&cur->ipv6_neighbour_cache);
125124
ipv6_route_table_remove_info(cur->id, ROUTE_THREAD_PROXIED_HOST, NULL);
126-
thread_routing_deactivate(&cur->thread_info->routing);
127-
thread_routing_init(&cur->thread_info->routing);
128-
cur->nwk_mode = ARM_NWK_GP_IP_MODE;
125+
thread_old_partition_data_purge(cur);
129126
thread_network_data_clean(cur);
127+
cur->nwk_mode = ARM_NWK_GP_IP_MODE;
130128
}
131129

132130
//This function is for Thread Parent scan callback
@@ -1139,6 +1137,7 @@ int8_t thread_host_bootstrap_child_update(int8_t interface_id, const uint8_t *ma
11391137
uint8_t mode;
11401138
uint32_t keySequence;
11411139

1140+
11421141
if (!cur->thread_info->thread_endnode_parent) {
11431142
return -1;
11441143
}
@@ -1199,6 +1198,7 @@ int8_t thread_host_bootstrap_child_update(int8_t interface_id, const uint8_t *ma
11991198
mle_service_set_packet_callback(bufId, thread_child_update_timeout_cb);
12001199
mle_service_set_msg_timeout_parameters(bufId, &timeout);
12011200
mle_service_send_message(bufId);
1201+
12021202
return 0;
12031203
}
12041204
int thread_host_bootstrap_child_update_negative_response(protocol_interface_info_entry_t *cur, uint8_t *dstAddress, mle_tlv_info_t *challenge)

source/6LoWPAN/Thread/thread_routing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,14 +879,14 @@ void thread_routing_init(thread_routing_info_t *routing)
879879
{
880880
ns_list_init(&routing->route_set);
881881
ns_list_init(&routing->link_set);
882-
routing->networkIdTimeout = NETWORK_ID_TIMEOUT;
883882
thread_routing_reset(routing);
884883
}
885884

886885
void thread_routing_reset(thread_routing_info_t *routing)
887886
{
888887
thread_routing_free(routing);
889888
routing->router_id_sequence_valid = false;
889+
routing->networkIdTimeout = NETWORK_ID_TIMEOUT;
890890
memset(routing->fast_route_table, FAST_ROUTE_INVALID_ID, sizeof routing->fast_route_table);
891891
trickle_start(&routing->mle_advert_timer, &thread_mle_advert_trickle_params);
892892
}

0 commit comments

Comments
 (0)