[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.
This commit is contained in:
Yakun Xu
2024-12-09 11:11:49 -08:00
committed by GitHub
parent fa9994a753
commit e314146a58
+2 -1
View File
@@ -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);