mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 06:07:48 +00:00
[mle] skip saving network info on role change to detached (#3553)
This commit changes the behavior of `Mle` to skip the saving of network info (to non-volatile memory) on role change to detached. Note that `Store()` does only update the MAC/MLE counters if device is not attached. The MAC/MLE counters update is tracked already by `KeyManager`.
This commit is contained in:
committed by
Jonathan Hui
parent
e990ede832
commit
ab871b5025
@@ -1522,7 +1522,13 @@ void Mle::HandleStateChanged(otChangedFlags aFlags)
|
||||
|
||||
if (aFlags & (OT_CHANGED_THREAD_ROLE | OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER))
|
||||
{
|
||||
Store();
|
||||
// Store the settings on a key seq change, or when role changes and device
|
||||
// is attached (i.e., skip `Store()` on role change to detached).
|
||||
|
||||
if ((aFlags & OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER) || IsAttached())
|
||||
{
|
||||
Store();
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & OT_CHANGED_SECURITY_POLICY)
|
||||
|
||||
Reference in New Issue
Block a user