mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 14:47:46 +00:00
[mle] stop attach timer from SetStateChild() (#3538)
This commit changes `SetStateChild()` to stop `mAttachTimer`. This ensures that as the `mAttachState` is set to idle, the attach timer is also stopped (note that the attach timer callback asserts on idle attach state). This addresses a rare issue where an inopportune device mode change request on an already attached device while it is performing periodic parent search (or possibly delaying processing of a received announce) could cause an assert; `SetDeviceMode()` would call `SetStateChild()` setting the attach state to idle while attach timer would continue to run.
This commit is contained in:
committed by
Jonathan Hui
parent
987ff3c017
commit
57e2f4e26d
@@ -737,6 +737,7 @@ void Mle::SetStateChild(uint16_t aRloc16)
|
||||
SetRloc16(aRloc16);
|
||||
SetRole(OT_DEVICE_ROLE_CHILD);
|
||||
SetAttachState(kAttachStateIdle);
|
||||
mAttachTimer.Stop();
|
||||
mAttachCounter = 0;
|
||||
mReattachState = kReattachStop;
|
||||
mChildUpdateAttempts = 0;
|
||||
|
||||
Reference in New Issue
Block a user