mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 06:30:10 +00:00
[nexus] clear last parent ID on router/leader role change (#12986)
In `Nexus::Core::HandleStateChanged`, the `lastParentId` was not cleared when a device transitioned to the Router or Leader role. This could cause stale parent associations to persist, leading to incorrect link state reporting in the visualizer during subsequent role transitions (e.g., when a former Leader merges into a partition and becomes a Child/REED). This fix clears `lastParentId` (sets it to `0xffff`) when the device becomes a Router or Leader, ensuring a fresh state for parent tracking.
This commit is contained in:
@@ -594,6 +594,11 @@ void Core::HandleStateChanged(otChangedFlags aFlags, void *aContext)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Mle::kRoleRouter:
|
||||
case Mle::kRoleLeader:
|
||||
node->SetLastParentId(0xffff);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user