[mle] remove queued outdated "Child Update Request" when there is newer network data to send (#2477)

This commit is contained in:
rongli
2018-01-16 17:07:18 +00:00
committed by Jonathan Hui
parent 1f4b082f2b
commit 7256270af0
+10 -2
View File
@@ -2979,12 +2979,20 @@ otError MleRouter::SendChildUpdateRequest(Child &aChild)
{
uint8_t childIndex = netif.GetMle().GetChildIndex(aChild);
// No need to send "Child Update Request" to the sleepy child if there is one already queued for it.
for (message = netif.GetMeshForwarder().GetSendQueue().GetHead(); message; message = message->GetNext())
{
if (message->GetChildMask(childIndex) && message->GetSubType() == Message::kSubTypeMleChildUpdateRequest)
{
ExitNow();
// No need to send the resync "Child Update Request" to the sleepy child
// if there is one already queued.
if (aChild.IsStateRestoring())
{
ExitNow();
}
// Remove queued outdated "Child Update Request" when there is newer Network Data is to send.
netif.GetMeshForwarder().RemoveMessages(aChild, Message::kSubTypeMleChildUpdateRequest);
break;
}
}
}