copy the packet before sending it down or up
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon Jan 07 18:20:18 2008 +0100 (2008-01-07)
changeset 220848ed970f6120
parent 2207 d841cca00990
child 2209 9b98d226e566
copy the packet before sending it down or up
src/devices/wifi/mac-high-nqap.cc
     1.1 --- a/src/devices/wifi/mac-high-nqap.cc	Thu Jan 03 14:14:17 2008 +0000
     1.2 +++ b/src/devices/wifi/mac-high-nqap.cc	Mon Jan 07 18:20:18 2008 +0100
     1.3 @@ -231,14 +231,17 @@
     1.4          {
     1.5            if (hdr->GetAddr3 () == m_device->GetSelfAddress ()) 
     1.6              {
     1.7 +              TRACE ("frame for me from="<<hdr->GetAddr2 ());
     1.8                m_forwardUp (packet, hdr->GetAddr2 ());
     1.9              } 
    1.10            else 
    1.11              {
    1.12 +              TRACE ("forwarding frame from="<<hdr->GetAddr2 ()<<", to="<<hdr->GetAddr3 ());
    1.13 +              Ptr<Packet> copy = packet->Copy ();
    1.14                ForwardDown (packet,
    1.15                             hdr->GetAddr2 (), 
    1.16                             hdr->GetAddr3 ());
    1.17 -              m_forwardUp (packet, hdr->GetAddr2 ());
    1.18 +              m_forwardUp (copy, hdr->GetAddr2 ());
    1.19              }
    1.20          } 
    1.21        else if (hdr->IsFromDs () &&