mirror of
https://github.com/espressif/openthread.git
synced 2026-10-02 13:57:38 +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);
|
SetRloc16(aRloc16);
|
||||||
SetRole(OT_DEVICE_ROLE_CHILD);
|
SetRole(OT_DEVICE_ROLE_CHILD);
|
||||||
SetAttachState(kAttachStateIdle);
|
SetAttachState(kAttachStateIdle);
|
||||||
|
mAttachTimer.Stop();
|
||||||
mAttachCounter = 0;
|
mAttachCounter = 0;
|
||||||
mReattachState = kReattachStop;
|
mReattachState = kReattachStop;
|
||||||
mChildUpdateAttempts = 0;
|
mChildUpdateAttempts = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user