Bug 1954 [wifi] - Serialized size of wifi-net-device differ for TX and RX trace
authorSébastien Deronne <sebastien.deronne@gmail.com>
Sat, 10 Oct 2015 11:43:00 +0200
changeset 11686 aa661e60709e
parent 11685 b4f43adac49d
child 11687 086b74c21de3
Bug 1954 [wifi] - Serialized size of wifi-net-device differ for TX and RX trace
RELEASE_NOTES
src/wifi/model/wifi-net-device.cc
--- a/RELEASE_NOTES	Sat Oct 10 11:05:11 2015 +0200
+++ b/RELEASE_NOTES	Sat Oct 10 11:43:00 2015 +0200
@@ -26,8 +26,9 @@
 Bugs fixed
 ----------
 - Bug 1132 - useless for loops in block-ack-test-suite.cc
+- Bug 1954 - Serialized size of wifi-net-device differ for TX and RX trace
+- Bug 2003 - Missing DSSS short PLCP preamble
 - Bug 2183 - LiIonEnergySourceHelper is not in the energy wscript
-- Bug 2003 - Missing DSSS short PLCP preamble
 - Bug 2184 - integer overflow in MacLow
 
 Known issues
--- a/src/wifi/model/wifi-net-device.cc	Sat Oct 10 11:05:11 2015 +0200
+++ b/src/wifi/model/wifi-net-device.cc	Sat Oct 10 11:43:00 2015 +0200
@@ -317,7 +317,6 @@
 WifiNetDevice::ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to)
 {
   LlcSnapHeader llc;
-  packet->RemoveHeader (llc);
   enum NetDevice::PacketType type;
   if (to.IsBroadcast ())
     {
@@ -336,17 +335,19 @@
       type = NetDevice::PACKET_OTHERHOST;
     }
 
+  if (!m_promiscRx.IsNull ())
+    {
+      m_mac->NotifyPromiscRx (packet);
+      packet->PeekHeader (llc);
+      m_promiscRx (this, packet, llc.GetType (), from, to, type);
+    }
+
   if (type != NetDevice::PACKET_OTHERHOST)
     {
       m_mac->NotifyRx (packet);
+      packet->RemoveHeader (llc);
       m_forwardUp (this, packet, llc.GetType (), from);
     }
-
-  if (!m_promiscRx.IsNull ())
-    {
-      m_mac->NotifyPromiscRx (packet);
-      m_promiscRx (this, packet, llc.GetType (), from, to, type);
-    }
 }
 
 void