From edc382137b782f714c4e7adbe1d592163e246eb0 Mon Sep 17 00:00:00 2001 From: Eugene Chemeritskiy Date: Tue, 25 Mar 2014 21:46:09 +0100 Subject: [PATCH] Bug 1887 - Point-to-point traces should contain PPP headers --- RELEASE_NOTES | 1 + .../model/point-to-point-net-device.cc | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index b383f439b..fd7d07e22 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -61,6 +61,7 @@ Bugs fixed - Bug 1874 - Ipv4L3Protocol::ProcessFragment: addressCombination and idProto identifiers not properly computed - 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 Release 3.19 ============= 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 645b5cf2f..a8f6b6d2c 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 @@ -318,13 +318,19 @@ PointToPointNetDevice::Receive (Ptr packet) { // // Hit the trace hooks. All of these hooks are in the same place in this - // device becuase it is so simple, but this is not usually the case in + // device because it is so simple, but this is not usually the case in // more complicated devices. // m_snifferTrace (packet); m_promiscSnifferTrace (packet); m_phyRxEndTrace (packet); + // + // Trace sinks will expect complete packets, not packets without some of the + // headers. + // + Ptr originalPacket = packet->Copy (); + // // Strip off the point-to-point protocol header and forward this packet // up the protocol stack. Since this is a simple point-to-point link, @@ -335,11 +341,11 @@ PointToPointNetDevice::Receive (Ptr packet) if (!m_promiscCallback.IsNull ()) { - m_macPromiscRxTrace (packet); + m_macPromiscRxTrace (originalPacket); m_promiscCallback (this, packet, protocol, GetRemote (), GetAddress (), NetDevice::PACKET_HOST); } - m_macRxTrace (packet); + m_macRxTrace (originalPacket); m_rxCallback (this, packet, protocol, GetRemote ()); } }