src/common/packet-history.cc
changeset 844 d17e2aca5a17
parent 843 b6670a38f2e8
child 845 7abb0f867d8f
--- a/src/common/packet-history.cc	Tue Jun 05 18:28:37 2007 +0200
+++ b/src/common/packet-history.cc	Tue Jun 05 21:48:26 2007 +0200
@@ -404,6 +404,17 @@
       PacketHistory::Recycle (m_data);
     }
   m_data = newData;
+  if (m_head != 0xffff)
+    {
+      uint8_t *start;
+      NS_ASSERT (m_tail != 0xffff);
+      // clear the next field of the tail
+      start = &m_data->m_data[m_tail];
+      Append16 (0xffff, &start);
+      // clear the prev field of the head
+      start = &m_data->m_data[m_head] + 2;
+      Append16 (0xffff, &start);
+    }
 }
 void
 PacketHistory::Reserve (uint32_t size)