From 7feb0b73c86a660276baa049dc07f25d48f6fcbe Mon Sep 17 00:00:00 2001 From: Eugene Chemeritskiy Date: Wed, 26 Mar 2014 23:39:32 +0100 Subject: [PATCH] Bug 1889 - PointToPointNetDevive: In some cases MacTxDrop trace is not called --- RELEASE_NOTES | 1 + .../model/point-to-point-net-device.cc | 27 +++++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index a62fa7f64..18cf9d70e 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -62,6 +62,7 @@ Bugs fixed - Bug 1882 - int64x64 tests trigger valgrind bug - Bug 1883 - IPv6 don't consider the prefix and network when choosing output address - Bug 1887 - Point-to-point traces should contain PPP headers +- Bug 1889 - PointToPointNetDevive: In some cases MacTxDrop trace is not called - Bug 1890 - UdpClientTrace: MPEG frame size is squeezed into (insufficient) 16 bit integer - Bug 1891 - UdpSocketImpl::GetSockName doesn't return the IPv6 address diff --git a/src/point-to-point/model/point-to-point-net-device.cc b/src/point-to-point/model/point-to-point-net-device.cc index a8f6b6d2c..6c98cedab 100644 --- a/src/point-to-point/model/point-to-point-net-device.cc +++ b/src/point-to-point/model/point-to-point-net-device.cc @@ -493,33 +493,26 @@ PointToPointNetDevice::Send ( m_macTxTrace (packet); // - // If there's a transmission in progress, we enque the packet for later - // transmission; otherwise we send it now. + // We should enqueue and dequeue the packet to hit the tracing hooks. // - if (m_txMachineState == READY) + if (m_queue->Enqueue (packet)) { - // - // Even if the transmitter is immediately available, we still enqueue and - // dequeue the packet to hit the tracing hooks. // - if (m_queue->Enqueue (packet) == true) + // If the channel is ready for transition we send the packet right now + // + if (m_txMachineState == READY) { packet = m_queue->Dequeue (); m_snifferTrace (packet); m_promiscSnifferTrace (packet); return TransmitStart (packet); } - else - { - // Enqueue may fail (overflow) - m_macTxDropTrace (packet); - return false; - } - } - else - { - return m_queue->Enqueue (packet); + return true; } + + // Enqueue may fail (overflow) + m_macTxDropTrace (packet); + return false; } bool