mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 21:30:24 +00:00
ef8deb506f
This commit adds a mechanism to delay the downgrade of routers or leader when the security policy TLV changes in the Active Operational Dataset such that the device is no longer eligible to act as a router. If the decision to become a child is made due to a security policy change, the device first delays a random period up to the "router selection jitter" before downgrading. If the device is the leader, an additional fixed delay of 10 seconds is added to the random period. If the security policy changes again while the device is waiting to downgrade such that it becomes router-eligible again, the downgrade is cancelled and the device remains in its current role. This commit adds a `test_router_downgrade_on_sec_policy_change` to validate the behavior of newly added mechanism. This commit also updates the CLI `dataset` sub-commands to allow getting and setting the "version threshold for routing" (VR) field in security policy.