From d5e147d400aafce96ddd568026918222b6400914 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 5 Jun 2007 15:59:07 +0200 Subject: [PATCH] deal with packet with zero headers correctly --- src/common/packet-history.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/packet-history.cc b/src/common/packet-history.cc index 60ab5efcf..bea6be0f5 100644 --- a/src/common/packet-history.cc +++ b/src/common/packet-history.cc @@ -548,11 +548,16 @@ PacketHistory::IsFF16 (uint16_t index) bool PacketHistory::CanAdd (bool atStart) { - if (atStart && m_begin != 0xffff) + if (m_begin == 0xffff) + { + NS_ASSERT (m_end == 0xffff); + return true; + } + if (atStart) { return IsFF16 (m_begin+2); } - else if (!atStart && m_end != 0xffff) + else if (!atStart) { return IsFF16 (m_end); }