[csl] fix 15.4-secured broadcast frames (#9103)

The CSL present flag was not cleared in the frame structure,
causing that the MAC security was not be processed for Key
ID Mode 2 frames. Consequently, MLE Announcements would be
rejected by the sub-MAC layer after a CSL receiver detached
from its parent.

Signed-off-by: Damian Krolik <[email protected]>
This commit is contained in:
Damian Królik
2023-05-30 11:31:57 -07:00
committed by GitHub
parent c187e4d049
commit b14646b5a8
4 changed files with 22 additions and 7 deletions
+1 -1
View File
@@ -907,7 +907,7 @@ void Mac::ProcessTransmitSecurity(TxFrame &aFrame)
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
// Transmit security will be processed after time IE content is updated.
VerifyOrExit(aFrame.mInfo.mTxInfo.mCslPresent == 0);
VerifyOrExit(!aFrame.IsCslIePresent());
#endif
aFrame.ProcessTransmitAesCcm(*extAddress);
+16
View File
@@ -1422,6 +1422,22 @@ public:
mInfo.mTxInfo.mIsSecurityProcessed = aIsSecurityProcessed;
}
/**
* Indicates whether or not the frame contains the CSL IE.
*
* @retval TRUE The frame contains the CSL IE.
* @retval FALSE The frame does not contain the CSL IE.
*
*/
bool IsCslIePresent(void) const { return mInfo.mTxInfo.mCslPresent; }
/**
* Sets the CSL IE present flag.
*
* @param[in] aCslPresent TRUE if the frame contains the CSL IE.
*/
void SetCslIePresent(bool aCslPresent) { mInfo.mTxInfo.mCslPresent = aCslPresent; }
/**
* Indicates whether or not the frame header is updated.
*
+3
View File
@@ -186,6 +186,9 @@ public:
mTxFrame802154.SetTxDelay(0);
mTxFrame802154.SetTxDelayBaseTime(0);
#endif
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
mTxFrame802154.SetCslIePresent(false);
#endif
#endif
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
mTxFrameTrel.SetLength(0);
+2 -6
View File
@@ -1702,12 +1702,8 @@ void MeshForwarder::AppendHeaderIe(const Message *aMessage, Mac::TxFrame &aFrame
if (Get<Mac::Mac>().IsCslEnabled())
{
IgnoreError(aFrame.AppendHeaderIeAt<Mac::CslIe>(index));
aFrame.mInfo.mTxInfo.mCslPresent = true;
iePresent = true;
}
else
{
aFrame.mInfo.mTxInfo.mCslPresent = false;
aFrame.SetCslIePresent(true);
iePresent = true;
}
#endif