Skip to content

Commit

Permalink
[mle] retain direct child cache entries on Addr Solicit Response TX (o…
Browse files Browse the repository at this point in the history
…penthread#9956)

Previously, when a child was promoted to a router role, the
leader upon sending "Address Solicit Response" would clear cache entries
associated with the child's old RLOC16. This commit modifies the code
to retain these cache entries when the sender is a direct child
of the leader. By retaining the cache entries, they can be associated
with the promoted router's new RLOC16 when the Link Advertisement is
received.
  • Loading branch information
abtink authored Mar 22, 2024
1 parent 8f379a6 commit 90adc86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/thread/mle_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3674,7 +3674,10 @@ void MleRouter::SendAddressSolicitResponse(const Coap::Message &aRequest,

// If assigning a new RLOC16 (e.g., on promotion of a child to
// router role) we clear any address cache entries associated
// with the old RLOC16.
// with the old RLOC16 unless the sender is a direct child. For
// direct children, we retain the cache entries to allow
// association with the promoted router's new RLOC16 upon
// receiving its Link Advertisement.

if ((aResponseStatus == ThreadStatusTlv::kSuccess) && (aRouter != nullptr))
{
Expand All @@ -3684,6 +3687,7 @@ void MleRouter::SendAddressSolicitResponse(const Coap::Message &aRequest,
oldRloc16 = aMessageInfo.GetPeerAddr().GetIid().GetLocator();

VerifyOrExit(oldRloc16 != aRouter->GetRloc16());
VerifyOrExit(!RouterIdMatch(oldRloc16, GetRloc16()));
Get<AddressResolver>().RemoveEntriesForRloc16(oldRloc16);
}

Expand Down

0 comments on commit 90adc86

Please sign in to comment.