Preserve packet tags upon IPv4 fragmentation
authorTommaso Pecorella <tommaso.pecorella@unifi.it>
Thu, 19 Dec 2013 21:43:02 -0800
changeset 10539 3bb6aa44d1f6
parent 10538 d0d87902f021
child 10540 322102df792e
Preserve packet tags upon IPv4 fragmentation
src/internet/model/ipv4-l3-protocol.cc
--- a/src/internet/model/ipv4-l3-protocol.cc	Wed Dec 18 18:49:26 2013 -0800
+++ b/src/internet/model/ipv4-l3-protocol.cc	Thu Dec 19 21:43:02 2013 -0800
@@ -1407,10 +1407,11 @@
 
   std::list<std::pair<Ptr<Packet>, uint16_t> >::const_iterator it = m_fragments.begin ();
 
-  Ptr<Packet> p = Create<Packet> ();
-  uint16_t lastEndOffset = 0;
+  Ptr<Packet> p = it->first->Copy ();
+  uint16_t lastEndOffset = p->GetSize ();
+  it++;
 
-  for ( it = m_fragments.begin (); it != m_fragments.end (); it++)
+  for ( ; it != m_fragments.end (); it++)
     {
       if ( lastEndOffset > it->second )
         {