Add WifiMacHeader in MonitorWifiMac itself default tip
authorLalith Suresh <suresh.lalith@gmail.com>
Sun, 17 Jul 2011 11:44:17 +0530
changeset 73374cbcbe42aaa6
parent 7336 0ac15aa63508
Add WifiMacHeader in MonitorWifiMac itself
src/wifi/model/mac-low.cc
src/wifi/model/monitor-wifi-mac.cc
     1.1 --- a/src/wifi/model/mac-low.cc	Sun Jul 17 11:32:05 2011 +0530
     1.2 +++ b/src/wifi/model/mac-low.cc	Sun Jul 17 11:44:17 2011 +0530
     1.3 @@ -677,15 +677,7 @@
     1.4     * packet queue.
     1.5     */
     1.6    WifiMacHeader hdr;
     1.7 -
     1.8 -  if (!m_monitorMode)
     1.9 -    {
    1.10 -      packet->RemoveHeader (hdr);
    1.11 -    }
    1.12 -  else
    1.13 -    {
    1.14 -      packet->Copy ()->RemoveHeader (hdr);
    1.15 -    }
    1.16 +  packet->RemoveHeader (hdr);
    1.17    m_currentRadiotapHdr = &radiotaphdr;
    1.18  
    1.19    bool isPrevNavZero = IsNavZero ();
     2.1 --- a/src/wifi/model/monitor-wifi-mac.cc	Sun Jul 17 11:32:05 2011 +0530
     2.2 +++ b/src/wifi/model/monitor-wifi-mac.cc	Sun Jul 17 11:44:17 2011 +0530
     2.3 @@ -372,6 +372,7 @@
     2.4    Mac48Address to = hdr->GetAddr1 ();
     2.5    Mac48Address from = hdr->GetAddr2 ();
     2.6    NS_LOG_DEBUG ("Received packet to: " << to << " from: " << from << " at:" << m_low->GetAddress ());
     2.7 +  packet->AddHeader (*hdr);
     2.8    packet->AddHeader (*radiotaphdr);
     2.9    ForwardUp (packet, from, to);
    2.10  }