mirror of
https://github.com/espressif/openthread.git
synced 2026-08-28 12:59:54 +00:00
[mle] restore operational datasets when becoming leader (#5036)
The leader is authoritative in the operational datasets that it distributes. This commit ensures that a device becoming a leader restores the operational dataset from non-volatile. This ensures that the operational datasets that the leader attempts to distribute are the same as in its non-volatile storage.
This commit is contained in:
@@ -337,6 +337,8 @@ void MleRouter::SetStateRouter(uint16_t aRloc16)
|
||||
|
||||
void MleRouter::SetStateLeader(uint16_t aRloc16)
|
||||
{
|
||||
IgnoreError(Get<MeshCoP::ActiveDataset>().Restore());
|
||||
IgnoreError(Get<MeshCoP::PendingDataset>().Restore());
|
||||
SetRloc16(aRloc16);
|
||||
|
||||
SetRole(kRoleLeader);
|
||||
|
||||
Reference in New Issue
Block a user