[mle] check router ID match when sending Child Id Response (#7428)

This commit updates the `SendChildIdResponse()` to check in the case
that the child already has a previously assigned RLOC16 that it
matches the current router ID of the parent and if not we assign a
new RLOC16 to it in the "Child ID response".
This commit is contained in:
Abtin Keshavarzian
2022-02-18 13:51:44 -08:00
committed by GitHub
parent 564982c818
commit 52777e8f8d
+1 -1
View File
@@ -3078,7 +3078,7 @@ Error MleRouter::SendChildIdResponse(Child &aChild)
SuccessOrExit(error = AppendActiveTimestamp(*message));
SuccessOrExit(error = AppendPendingTimestamp(*message));
if (aChild.GetRloc16() == 0)
if ((aChild.GetRloc16() == 0) || !RouterIdMatch(aChild.GetRloc16(), GetRloc16()))
{
uint16_t rloc16;