[mle] improve Graceful Detach for Routers (#11805)

Cause FTD children to detach if their parent router was removed from
the route TLV.
This commit is contained in:
Tom Rebbert
2025-08-18 12:27:48 -07:00
committed by GitHub
parent 2a719180aa
commit f3efd14e96
+4 -1
View File
@@ -1076,8 +1076,11 @@ Error Mle::ProcessRouteTlv(const RouteTlv &aRouteTlv, RxInfo &aRxInfo)
mRouterTable.UpdateRouterIdSet(aRouteTlv.GetRouterIdSequence(), aRouteTlv.GetRouterIdMask());
if (IsRouter() && !mRouterTable.IsAllocated(mRouterId))
if (IsAttached() && !mRouterTable.IsAllocated(RouterIdFromRloc16(GetRloc16())))
{
// Either we're a router and our own router ID has been removed from the router table,
// or we're a child and our parent's router ID has been removed from the router table.
// Detach immediately to minimize time where we're not connected.
IgnoreError(BecomeDetached());
error = kErrorNoRoute;
}