From e314146a58a035b31955dbb6e8a5c03f5876dc8c Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Tue, 10 Dec 2024 03:11:49 +0800 Subject: [PATCH] [mle] do not request link if not recognized (#11007) If the new router is not in peer's route TLV, the link request would be ignored, causing the link establishment stuck at the Link Request stage until timeout when a new attempt could proceed. This commit adds a check on the initiator to make sure the peer router's Route TLV contains the initiator's router id before sending the link request, otherwise it refrains from initiating the link establishment. --- src/core/thread/mle_router.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index c56d55d04..432876917 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -1348,7 +1348,8 @@ Error MleRouter::HandleAdvertisementOnFtd(RxInfo &aRxInfo, uint16_t aSourceAddre // Send unicast link request if no link to router and no // unicast/multicast link request in progress - if (!router->IsStateValid() && !router->IsStateLinkRequest() && (linkMargin >= kLinkRequestMinMargin)) + if (!router->IsStateValid() && !router->IsStateLinkRequest() && (linkMargin >= kLinkRequestMinMargin) && + routeTlv.IsRouterIdSet(mRouterId)) { InitNeighbor(*router, aRxInfo); router->SetState(Neighbor::kStateLinkRequest);