[mesh-forwarder] verify data request is ack with fp=1 (#3785)

This commit is contained in:
Yakun Xu
2019-04-30 18:37:48 -07:00
committed by Jonathan Hui
parent d348ce2bbc
commit 617f8958dd
24 changed files with 92 additions and 16 deletions
+3
View File
@@ -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())
+3
View File
@@ -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())
+3
View File
@@ -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())
+3
View File
@@ -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())
+4
View File
@@ -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;
+4
View File
@@ -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())
+3
View File
@@ -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);
}
+4
View File
@@ -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);
}
+4
View File
@@ -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())
+4
View File
@@ -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())
+4
View File
@@ -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())
+2
View File
@@ -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))
{
+2
View File
@@ -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))
{
+4
View File
@@ -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);
}
+4
View File
@@ -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())