From 47efcc674543868a8e765c9cb0806ba5b948feb0 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Sun, 26 Sep 2021 18:50:17 -0700 Subject: [PATCH] [sub-mac] check `IsHeaderUpdated() before signaling counter (#7029) This commit adds a check in `SignalFrameCounterUsedOnTxDone()` to ensure that radio platform did indeed update the header (i.e., assigned a frame counter) before reading the counter value from the frame and signaling its use. --- src/core/mac/sub_mac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/mac/sub_mac.cpp b/src/core/mac/sub_mac.cpp index d3f248b00..22c361531 100644 --- a/src/core/mac/sub_mac.cpp +++ b/src/core/mac/sub_mac.cpp @@ -579,7 +579,7 @@ void SubMac::SignalFrameCounterUsedOnTxDone(const TxFrame &aFrame) OT_UNUSED_VARIABLE(allowError); - VerifyOrExit(!ShouldHandleTransmitSecurity() && aFrame.GetSecurityEnabled()); + VerifyOrExit(!ShouldHandleTransmitSecurity() && aFrame.GetSecurityEnabled() && aFrame.IsHeaderUpdated()); // In an FTD/MTD build, if/when link-raw is enabled, the `TxFrame` // is prepared and given by user and may not necessarily follow 15.4