# HG changeset patch # User Tom Henderson # Date 1262993273 28800 # Node ID 07be4d0654854f83c18c0ec24d2f038bba838071 # Parent 8788d85a6c3ea8dda704db5f87ae610f1b7cc9a3 bug 731: Send function in point-to-point-net-device fails to check the return value of the Dequeue function diff -r 8788d85a6c3e -r 07be4d065485 src/devices/point-to-point/point-to-point-net-device.cc --- a/src/devices/point-to-point/point-to-point-net-device.cc Fri Jan 08 18:04:01 2010 +0100 +++ b/src/devices/point-to-point/point-to-point-net-device.cc Fri Jan 08 15:27:53 2010 -0800 @@ -511,11 +511,19 @@ // 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 {