From 7eb9af58065c2741c276285fb25ac7b371447ecc Mon Sep 17 00:00:00 2001 From: zhangwenxu Date: Fri, 19 May 2023 13:36:12 +0800 Subject: [PATCH] openthread: fix frame counter when re-transmition --- components/openthread/port/esp_openthread_radio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/openthread/port/esp_openthread_radio.c b/components/openthread/port/esp_openthread_radio.c index 80f8020f9f..a8616a7fdf 100644 --- a/components/openthread/port/esp_openthread_radio.c +++ b/components/openthread/port/esp_openthread_radio.c @@ -300,7 +300,9 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame) aFrame->mPsdu[-1] = aFrame->mLength; // lenth locates one byte before the psdu (esp_openthread_radio_tx_psdu); if (otMacFrameIsSecurityEnabled(aFrame) && !aFrame->mInfo.mTxInfo.mIsSecurityProcessed) { - otMacFrameSetFrameCounter(aFrame, s_mac_frame_counter++); + if (!s_transmit_frame.mInfo.mTxInfo.mIsARetx) { + otMacFrameSetFrameCounter(aFrame, s_mac_frame_counter++); + } if (otMacFrameIsKeyIdMode1(aFrame)) { s_transmit_frame.mInfo.mTxInfo.mAesKey = &s_current_key; if (!s_transmit_frame.mInfo.mTxInfo.mIsARetx) {