[fuzz] expect no ACK if TX frame is invalid (#10951)

The Sequence Number Suppression field and AR can be both 1 in fuzz test,
in which case, the frame is not valid. And no ack should be expected.
This commit changes the expectation in this case.
This commit is contained in:
Yakun Xu
2024-11-22 10:13:27 +08:00
committed by GitHub
parent b617ba3b71
commit 025d84ba1e

View File

@ -45,6 +45,7 @@
#include <openthread/platform/settings.h>
#include "mac/mac_frame.hpp"
#include "openthread/error.h"
using namespace ot;
@ -118,11 +119,17 @@ void FuzzerPlatformProcess(otInstance *aInstance)
sRadioAckFrame.mLength = IEEE802154_ACK_LENGTH;
sRadioAckFrame.mPsdu[0] = IEEE802154_FRAME_TYPE_ACK;
sRadioAckFrame.mPsdu[1] = 0;
error = otMacFrameGetSequence(&sRadioTransmitFrame, &sRadioAckFrame.mPsdu[2]);
OT_ASSERT(error == OT_ERROR_NONE);
sRadioAckFrame.mChannel = sRadioTransmitFrame.mChannel;
error = otMacFrameGetSequence(&sRadioTransmitFrame, &sRadioAckFrame.mPsdu[2]);
otPlatRadioTxDone(aInstance, &sRadioTransmitFrame, &sRadioAckFrame, OT_ERROR_NONE);
if (error == OT_ERROR_NONE)
{
otPlatRadioTxDone(aInstance, &sRadioTransmitFrame, &sRadioAckFrame, OT_ERROR_NONE);
}
else
{
otPlatRadioTxDone(aInstance, &sRadioTransmitFrame, nullptr, OT_ERROR_NO_ACK);
}
}
else
{