Skip to content

Commit edd7599

Browse files
RLOC was updated before clearing child info (ARMmbed#1547)
based on old RLOC. Fix first clears the child info based on old RLOC before updating RLOC.
1 parent a666056 commit edd7599

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,10 +1011,19 @@ static void thread_bootstrap_client_router_id_cb(int8_t interface_id, int8_t sta
10111011
parent_router_id = cur->thread_info->thread_endnode_parent->router_id;
10121012
}
10131013

1014+
tr_info("Thread Short address changed old: %x new: %x", cur->thread_info->routerShortAddress, router_rloc);
1015+
/*the default routerShortAddress if nothing is requested is 0xfffe so eliminate this case
1016+
Also make sure that the child info (from previous partition if any)
1017+
is cleared if the router address requested is not what is got from leader */
1018+
if ( cur->thread_info->routerShortAddress != router_rloc) {
1019+
thread_router_bootstrap_child_information_clear(cur);
1020+
}
1021+
// Release network data from old address
1022+
cur->thread_info->localServerDataBase.release_old_address = true;
1023+
10141024
//ADD New ML16
10151025
// This should be used thread_bootstrap_update_ml16_address(cur, router_rloc);
10161026
thread_clean_old_16_bit_address_based_addresses(cur);
1017-
10181027
mac_helper_mac16_address_set(cur, router_rloc);
10191028
cur->thread_info->routerShortAddress = router_rloc;
10201029
memcpy(ml16, cur->thread_info->threadPrivatePrefixInfo.ulaPrefix, 8);
@@ -1028,16 +1037,6 @@ static void thread_bootstrap_client_router_id_cb(int8_t interface_id, int8_t sta
10281037
return;
10291038
}
10301039

1031-
tr_info("Thread Short address changed old: %x new: %x", cur->thread_info->routerShortAddress, router_rloc);
1032-
/*the default routerShortAddress if nothing is requested is 0xfffe so eliminate this case
1033-
Also make sure that the child info (from previous partition if any)
1034-
is cleared if the router address requested is not what is got from leader */
1035-
if (cur->thread_info->routerShortAddress != router_rloc) {
1036-
thread_router_bootstrap_child_information_clear(cur);
1037-
}
1038-
// Release network data from old address
1039-
cur->thread_info->localServerDataBase.release_old_address = true;
1040-
10411040
// /* XXX Is short_src_adr ever reset? Is it undefined if info not in msg? */
10421041
tr_debug("Route seq %d Router mask: %s", routeId, trace_array(router_mask_ptr, 8));
10431042
cur->thread_info->routing.router_id_sequence_valid = false;

0 commit comments

Comments
 (0)