[mle] ignore parent and child-update requests on parent when detaching (#11806)

This change ensures that a parent device in the process of detaching
from the network ignores incoming "Parent Request" and "Child Update
Request" messages.

A new `Detacher::IsDetaching()` method is added to check for this
state. This prevents potential inefficiencies that could arise if
these requests were responded during the detachment procedure.
This commit is contained in:
Abtin Keshavarzian
2025-08-12 12:13:19 -07:00
committed by GitHub
parent 318006e4da
commit 184c4ca9ed
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -1801,6 +1801,7 @@ private:
void HandleTimer(void);
Error HandleChildUpdateResponse(uint32_t aTimeout);
void HandleStop(void);
bool IsDetaching(void) const { return mState == kDetaching; }
private:
static constexpr uint32_t kTimeout = 1000;
+4
View File
@@ -1404,6 +1404,8 @@ void Mle::HandleParentRequest(RxInfo &aRxInfo)
VerifyOrExit(IsRouterEligible());
VerifyOrExit(!IsDetached() && !IsAttaching());
VerifyOrExit(!mDetacher.IsDetaching());
VerifyOrExit(mRouterTable.GetLeaderAge() < mNetworkIdTimeout, error = kErrorDrop);
VerifyOrExit(mRouterTable.GetPathCostToLeader() < kMaxRouteCost, error = kErrorDrop);
@@ -2205,6 +2207,8 @@ void Mle::HandleChildUpdateRequestOnParent(RxInfo &aRxInfo)
Log(kMessageReceive, kTypeChildUpdateRequestOfChild, aRxInfo.mMessageInfo.GetPeerAddr());
VerifyOrExit(!mDetacher.IsDetaching());
SuccessOrExit(error = aRxInfo.mMessage.ReadModeTlv(mode));
switch (aRxInfo.mMessage.ReadChallengeTlv(challenge))