bug 731: Send function in point-to-point-net-device fails to check the return value of the Dequeue function

This commit is contained in:
Tom Henderson
2010-01-08 15:27:53 -08:00
parent c80d247e78
commit 80d316183c

View File

@@ -511,11 +511,19 @@ PointToPointNetDevice::Send(
// Even if the transmitter is immediately available, we still enqueue and
// dequeue the packet to hit the tracing hooks.
//
m_queue->Enqueue (packet);
packet = m_queue->Dequeue ();
m_snifferTrace (packet);
m_promiscSnifferTrace (packet);
return TransmitStart (packet);
if (m_queue->Enqueue (packet) == true)
{
packet = m_queue->Dequeue ();
m_snifferTrace (packet);
m_promiscSnifferTrace (packet);
return TransmitStart (packet);
}
else
{
// Enqueue may fail (overflow)
m_macTxDropTrace (packet);
return false;
}
}
else
{