From c26f5e3bbee10bcd2fe55284af6d07e6d670a12d Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 4 Jan 2018 09:38:37 -0800 Subject: [PATCH] [child-supervision] relax the check for starting the supervision timeout timer (#2446) This commit changes the `SupervisionListener` implementation by relaxing the checks for when to start the supervision listener timeout timer, in particular relaxing the check for role to be `ROLE_CHILD`. This addresses an issue where timer may not start during (re-)attach process after a "Child Id Request" transmission where the device becomes sleepy but it's not yet fully attached as a child. --- src/core/utils/child_supervision.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/utils/child_supervision.cpp b/src/core/utils/child_supervision.cpp index 55da45293..eb55b12b5 100644 --- a/src/core/utils/child_supervision.cpp +++ b/src/core/utils/child_supervision.cpp @@ -214,9 +214,7 @@ void SupervisionListener::RestartTimer(void) { ThreadNetif &netif = GetNetif(); - // Restart the timer, if the timeout value is non-zero and the device is a sleepy child. - - if ((mTimeout != 0) && (netif.GetMle().GetRole() == OT_DEVICE_ROLE_CHILD) && + if ((mTimeout != 0) && (netif.GetMle().GetRole() != OT_DEVICE_ROLE_DISABLED) && (netif.GetMeshForwarder().GetRxOnWhenIdle() == false)) { mTimer.Start(TimerMilli::SecToMsec(mTimeout));