mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 09:27:47 +00:00
[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:
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user