Skip to content

Commit a1acffc

Browse files
author
Arto Kinnunen
authored
Update Thread publishing during address change (#1581)
Pending request is cancelled if device address has changed. Following publish will trigger new a/sd.
1 parent d2ddb1a commit a1acffc

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

source/6LoWPAN/Thread/thread_bootstrap.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,13 +1010,7 @@ void thread_tasklet(arm_event_s *event)
10101010
thread_bootstrap_child_id_request(cur);
10111011
if (thread_nd_own_service_list_data_size(&cur->thread_info->localServerDataBase)) {
10121012
// publish our services to allow leader to remove old ones
1013-
if (!cur->thread_info->localServerDataBase.publish_active) {
1014-
/*
1015-
* publish only when publish is not active, otherwise let resubmit timer check
1016-
* handle publish after short time period.
1017-
*/
1018-
thread_border_router_publish(cur->id);
1019-
}
1013+
thread_border_router_publish(cur->id);
10201014
}
10211015
thread_router_bootstrap_address_change_notify_send(cur);
10221016
// Validate network data after a short period

source/6LoWPAN/Thread/thread_border_router_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,12 @@ int thread_border_router_publish(int8_t interface_id)
887887
if (rloc16 != cur->thread_info->localServerDataBase.registered_rloc16) {
888888
/*
889889
* Device short address has changed, cancel previous a/sd and a/as requests
890+
* and start resubmit timer
890891
* */
892+
tr_debug("address changed, kill pending reuqests");
891893
thread_management_client_pending_coap_request_kill(cur->id);
894+
thread_border_router_resubmit_timer_set(interface_id, 5);
895+
return 0;
892896
} else {
893897
cur->thread_info->localServerDataBase.publish_pending = true;
894898
tr_debug("Activate pending status for publish");

0 commit comments

Comments
 (0)