[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:
Abtin Keshavarzian
2018-12-13 09:00:37 -08:00
committed by Jonathan Hui
parent de63012c9e
commit cf841b1b71
+12 -9
View File
@@ -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++;
}
}
}
}