From d8a2cd9a70cfda7c2657645b4a57411eadaa4e61 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 26 Feb 2021 15:11:07 -0800 Subject: [PATCH] [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). --- src/core/thread/indirect_sender.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/thread/indirect_sender.cpp b/src/core/thread/indirect_sender.cpp index dd0375433..3e93c9cf2 100644 --- a/src/core/thread/indirect_sender.cpp +++ b/src/core/thread/indirect_sender.cpp @@ -109,6 +109,8 @@ void IndirectSender::AddMessageForSleepyChild(Message &aMessage, Child &aChild) if (supervisionMessage != nullptr) { IgnoreError(RemoveMessageFromSleepyChild(*supervisionMessage, aChild)); + Get().mSendQueue.Dequeue(*supervisionMessage); + supervisionMessage->Free(); } }