From 90c090f1efe6d726285175d17e38958b4384be58 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 12 Jun 2023 11:29:06 -0700 Subject: [PATCH] [mle] send unicast Link Request to 1.2 parent on router role promo (#9154) This commit adds a new mechanism to send a unicast MLE Link Request to the device's former parent if its version is earlier than 1.3.0, when the device is promoted from a child to a router role. This is to address a potential compatibility issue with some non-OpenThread stacks which may ignore MLE Advertisements from a previous/existing child. --- src/core/thread/mle_router.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index ee402bbe5..c79a0745e 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -3542,6 +3542,16 @@ void MleRouter::HandleAddressSolicitResponse(Coap::Message *aMessage, leader->SetNextHopAndCost(RouterIdFromRloc16(mParent.GetRloc16()), mParent.GetLeaderCost()); } + // We send a unicast Link Request to our former parent if its + // version is earlier than 1.3. This is to address a potential + // compatibility issue with some non-OpenThread stacks which may + // ignore MLE Advertisements from a former/existing child. + + if (mParent.GetVersion() < kThreadVersion1p3) + { + IgnoreError(SendLinkRequest(&mParent)); + } + // We send an Advertisement to inform our former parent of our // newly allocated Router ID. This will cause the parent to // reset its advertisement trickle timer which can help speed