mirror of
https://github.com/espressif/openthread.git
synced 2026-08-31 14:29:54 +00:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user