mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 20:50:05 +00:00
[mesh-forwarder] verify data request is ack with fp=1 (#3785)
This commit is contained in:
@@ -1881,6 +1881,9 @@ static void cc1352RadioProcessTransmitDone(otInstance * aInstance,
|
||||
|
||||
static void cc1352RadioProcessReceiveDone(otInstance *aInstance, otRadioFrame *aReceiveFrame, otError aReceiveError)
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aReceiveFrame->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -711,6 +711,9 @@ void cc2538RadioProcess(otInstance *aInstance)
|
||||
if ((sState == OT_RADIO_STATE_RECEIVE && sReceiveFrame.mLength > 0) ||
|
||||
(sState == OT_RADIO_STATE_TRANSMIT && sReceiveFrame.mLength > IEEE802154_ACK_LENGTH))
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -1798,6 +1798,9 @@ static void cc2650RadioProcessTransmitDone(otInstance * aInstance,
|
||||
|
||||
static void cc2650RadioProcessReceiveDone(otInstance *aInstance, otRadioFrame *aReceiveFrame, otError aReceiveError)
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aReceiveFrame->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -1861,6 +1861,9 @@ static void cc2652RadioProcessTransmitDone(otInstance * aInstance,
|
||||
|
||||
static void cc2652RadioProcessReceiveDone(otInstance *aInstance, otRadioFrame *aReceiveFrame, otError aReceiveError)
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aReceiveFrame->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -508,6 +508,10 @@ void da15000RadioProcess(otInstance *aInstance)
|
||||
sAckFrame = true;
|
||||
}
|
||||
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame[sReadFrame].mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
otPlatRadioReceiveDone(sThreadInstance, &sReceiveFrame[sReadFrame], OT_ERROR_NONE);
|
||||
|
||||
sReadFrame = (sReadFrame + 1) % RADIO_FRAMES_BUFFER_SIZE;
|
||||
|
||||
@@ -680,6 +680,10 @@ static void processNextRxPacket(otInstance *aInstance, RAIL_Handle_t aRailHandle
|
||||
|
||||
sReceiveError = OT_ERROR_NONE;
|
||||
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -564,6 +564,9 @@ void emskRadioProcess(otInstance *aInstance)
|
||||
|
||||
if ((sState == OT_RADIO_STATE_RECEIVE) && (sReceiveFrame.mLength > 0))
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
otPlatRadioReceiveDone(aInstance, &sReceiveFrame, sReceiveError);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,6 +226,10 @@ void cbQorvoRadioReceiveDone(otRadioFrame *aPacket, otError aError)
|
||||
sLastReceivedPower = aPacket->mInfo.mRxInfo.mRssi;
|
||||
}
|
||||
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aPacket->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
otPlatRadioReceiveDone(pQorvoInstance, aPacket, aError);
|
||||
}
|
||||
|
||||
|
||||
@@ -987,6 +987,10 @@ void kw41zRadioProcess(otInstance *aInstance)
|
||||
|
||||
if (sRxDone)
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sRxFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -552,6 +552,10 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
if (sReceivedFrames[i].mPsdu != NULL)
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceivedFrames[i].mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -552,6 +552,10 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
if (sReceivedFrames[i].mPsdu != NULL)
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceivedFrames[i].mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
@@ -776,6 +776,7 @@ void radioSendAck(void)
|
||||
if (isDataRequestAndHasFramePending(sReceiveFrame.mPsdu))
|
||||
{
|
||||
sAckMessage.mPsdu[0] |= IEEE802154_FRAME_PENDING;
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
}
|
||||
|
||||
sAckMessage.mPsdu[1] = 0;
|
||||
@@ -824,6 +825,7 @@ void radioProcessFrame(otInstance *aInstance)
|
||||
sReceiveFrame.mInfo.mRxInfo.mRssi = -20;
|
||||
sReceiveFrame.mInfo.mRxInfo.mLqi = OT_RADIO_LQI_NONE;
|
||||
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = false;
|
||||
// generate acknowledgment
|
||||
if (isAckRequested(sReceiveFrame.mPsdu))
|
||||
{
|
||||
|
||||
@@ -642,6 +642,7 @@ void radioSendAck(void)
|
||||
if (isDataRequestAndHasFramePending(sReceiveFrame.mPsdu))
|
||||
{
|
||||
sAckMessage.mPsdu[0] |= IEEE802154_FRAME_PENDING;
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
}
|
||||
|
||||
sAckMessage.mPsdu[1] = 0;
|
||||
@@ -690,6 +691,7 @@ void radioProcessFrame(otInstance *aInstance)
|
||||
sReceiveFrame.mInfo.mRxInfo.mRssi = -20;
|
||||
sReceiveFrame.mInfo.mRxInfo.mLqi = OT_RADIO_LQI_NONE;
|
||||
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = false;
|
||||
// generate acknowledgment
|
||||
if (isAckRequested(sReceiveFrame.mPsdu))
|
||||
{
|
||||
|
||||
@@ -217,6 +217,10 @@ void cbQorvoRadioTransmitDone(otRadioFrame *aPacket, bool aFramePending, otError
|
||||
|
||||
void cbQorvoRadioReceiveDone(otRadioFrame *aPacket, otError aError)
|
||||
{
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aPacket->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
otPlatRadioReceiveDone(pQorvoInstance, aPacket, aError);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +225,10 @@ static void handleRx(void)
|
||||
sReceiveFrame.mInfo.mRxInfo.mUsec = 0; // Don't support microsecond timer for now.
|
||||
}
|
||||
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
|
||||
Reference in New Issue
Block a user