From fe99f1144a9a21af062366bed734d6d781ed03bc Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Wed, 4 Jan 2017 10:47:43 +0100 Subject: [PATCH] TSCH bugfix: reset keep-alive timeout when switching time source --- core/net/mac/tsch/tsch-queue.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/net/mac/tsch/tsch-queue.c b/core/net/mac/tsch/tsch-queue.c index e3f60f45c..e8ebe7aa3 100644 --- a/core/net/mac/tsch/tsch-queue.c +++ b/core/net/mac/tsch/tsch-queue.c @@ -163,6 +163,13 @@ tsch_queue_update_time_source(const linkaddr_t *new_addr) /* Update time source */ if(new_time_src != NULL) { new_time_src->is_time_source = 1; + /* (Re)set keep-alive timeout */ + tsch_set_ka_timeout(TSCH_KEEPALIVE_TIMEOUT); + /* Start sending keepalives */ + tsch_schedule_keepalive(); + } else { + /* Stop sending keepalives */ + tsch_set_ka_timeout(0); } if(old_time_src != NULL) {