[indirect-sender] free and dequeue the supervision message when removed (#6213)

This commit fixes an issue with removal of supervision message
for child when another message is queued for the same child.
This fixes an issue added by PR#5638 (which itself addresses
an issue that if the supervision message was removed while MAC
was busy sending the message, the MAC layer would not be
notified of the removal).
This commit is contained in:
Abtin Keshavarzian
2021-02-26 15:11:07 -08:00
committed by GitHub
parent 8e872ee5ac
commit d8a2cd9a70
+2
View File
@@ -109,6 +109,8 @@ void IndirectSender::AddMessageForSleepyChild(Message &aMessage, Child &aChild)
if (supervisionMessage != nullptr)
{
IgnoreError(RemoveMessageFromSleepyChild(*supervisionMessage, aChild));
Get<MeshForwarder>().mSendQueue.Dequeue(*supervisionMessage);
supervisionMessage->Free();
}
}