[mle-router] stop mStateUpdateTimer on mode change (#3376)

This commit ensures to not re-start the `mStateUpdateTimer` from its
callback, when router role is disabled. This addresses the issue where
a mode change (disabling router role) could cause the timer to
continue to fire indefinitely, further causing device to attempt to
reattach from each timer callback.

Thanks to Conor O'Neill (@conormoneill) for discovering and debugging
this issue.
This commit is contained in:
Abtin Keshavarzian
2018-12-14 11:21:55 -08:00
committed by Jonathan Hui
parent 4279dbc14c
commit 200b3dabcf
+2
View File
@@ -1690,6 +1690,8 @@ void MleRouter::HandleStateUpdateTimer(void)
{
bool routerStateUpdate = false;
VerifyOrExit(IsRouterRoleEnabled());
mStateUpdateTimer.Start(kStateUpdatePeriod);
if (mChallengeTimeout > 0)