[mle] always echo back AR TLV in Child ID/Update Response (#4162)

This commit ensures that a Child ID/Update Response message always
includes an Address Registration TLV when the Child ID/Update Request
message	includes an Address Registration TLV, even when there are no
IPv6 addresses to include.

This commit reverts a change in commit 1133983.
This commit is contained in:
Simon Lin
2019-09-12 08:51:39 -07:00
committed by Jonathan Hui
parent 8595924e6c
commit 4dc58da927
+2 -10
View File
@@ -4355,16 +4355,8 @@ otError MleRouter::AppendChildAddresses(Message &aMessage, Child &aChild)
length += entry.GetLength();
}
if (length > 0)
{
tlv.SetLength(length);
aMessage.Write(startOffset, sizeof(tlv), &tlv);
}
else
{
// remove AddressRegistrationTlv if no address to be echoed back
aMessage.SetLength(startOffset);
}
tlv.SetLength(length);
aMessage.Write(startOffset, sizeof(tlv), &tlv);
exit:
return error;