mirror of
https://github.com/espressif/openthread.git
synced 2026-08-21 18:09:52 +00:00
[mesh-forwarder] fix double logging msg tx to non-sleepy child (#3368)
This commit moves the logging of a message transmission status and updating of the counters in `MeshForwarder::HandleSentFrameToChild()` inside an `if` block checking for the message to be indirect. This change addresses an issue where message transmissions to a non-sleepy child could be logged and counted twice from both `HandleSentFrame()` and `HandleSentFrameToChild()`.
This commit is contained in:
committed by
Jonathan Hui
parent
de63012c9e
commit
cf841b1b71
@@ -723,17 +723,20 @@ void MeshForwarder::HandleSentFrameToChild(const Mac::Frame &aFrame, otError aEr
|
||||
mSourceMatchController.DecrementMessageCount(*child);
|
||||
}
|
||||
|
||||
LogMessage(kMessageTransmit, *mSendMessage, &aMacDest, txError);
|
||||
|
||||
if (mSendMessage->GetType() == Message::kTypeIp6)
|
||||
if (!mSendMessage->GetDirectTransmission())
|
||||
{
|
||||
if (mSendMessage->GetTxSuccess())
|
||||
LogMessage(kMessageTransmit, *mSendMessage, &aMacDest, txError);
|
||||
|
||||
if (mSendMessage->GetType() == Message::kTypeIp6)
|
||||
{
|
||||
mIpCounters.mTxSuccess++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mIpCounters.mTxFailure++;
|
||||
if (mSendMessage->GetTxSuccess())
|
||||
{
|
||||
mIpCounters.mTxSuccess++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mIpCounters.mTxFailure++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user