src/internet/model/ipv4-l3-protocol.cc
changeset 10539 3bb6aa44d1f6
parent 10512 f222d52c616f
child 10646 a68b000ae77b
equal deleted inserted replaced
10538:d0d87902f021 10539:3bb6aa44d1f6
  1405 {
  1405 {
  1406   NS_LOG_FUNCTION (this);
  1406   NS_LOG_FUNCTION (this);
  1407 
  1407 
  1408   std::list<std::pair<Ptr<Packet>, uint16_t> >::const_iterator it = m_fragments.begin ();
  1408   std::list<std::pair<Ptr<Packet>, uint16_t> >::const_iterator it = m_fragments.begin ();
  1409 
  1409 
  1410   Ptr<Packet> p = Create<Packet> ();
  1410   Ptr<Packet> p = it->first->Copy ();
  1411   uint16_t lastEndOffset = 0;
  1411   uint16_t lastEndOffset = p->GetSize ();
  1412 
  1412   it++;
  1413   for ( it = m_fragments.begin (); it != m_fragments.end (); it++)
  1413 
       
  1414   for ( ; it != m_fragments.end (); it++)
  1414     {
  1415     {
  1415       if ( lastEndOffset > it->second )
  1416       if ( lastEndOffset > it->second )
  1416         {
  1417         {
  1417           // The fragments are overlapping.
  1418           // The fragments are overlapping.
  1418           // We do not overwrite the "old" with the "new" because we do not know when each arrived.
  1419           // We do not overwrite the "old" with the "new" because we do not know when each arrived.