deal with packet with zero headers correctly

Mathieu Lacage 2007-06-05 15:59:07 +02:00
parent 35dbade0a9
commit d5e147d400
1 changed files with 7 additions and 2 deletions

View File

@ -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);
}