From 319068637c8fac79f49b77c1fd484fe7c9fccd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Maciejo=C5=84czyk?= <32327281+lmaciejonczyk@users.noreply.github.com> Date: Fri, 29 Oct 2021 19:56:55 +0200 Subject: [PATCH] [mac] don't append header termination IE2 for empty data payload (#7123) We do not require the HT2 IE if the only thing that follows the header is the MIC. This commit reverts #6941. --- src/core/thread/mesh_forwarder.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/thread/mesh_forwarder.cpp b/src/core/thread/mesh_forwarder.cpp index a0b02f507..081acb2c6 100644 --- a/src/core/thread/mesh_forwarder.cpp +++ b/src/core/thread/mesh_forwarder.cpp @@ -1582,10 +1582,8 @@ void MeshForwarder::AppendHeaderIe(const Message *aMessage, Mac::TxFrame &aFrame { uint8_t index = 0; bool iePresent = false; - // MIC is a part of Data Payload, so if it's present, Data Payload is not empty even if the message is - // MIC is always present when the frame is secured - bool payloadPresent = (aFrame.GetType() == Mac::Frame::kFcfFrameMacCmd) || - (aMessage != nullptr && aMessage->GetLength() != 0) || aFrame.GetSecurityEnabled(); + bool payloadPresent = + (aFrame.GetType() == Mac::Frame::kFcfFrameMacCmd) || (aMessage != nullptr && aMessage->GetLength() != 0); #if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE if (aMessage != nullptr && aMessage->IsTimeSync())