From 2de69f5590874fcc9efea8cfcaf064f6465bdad0 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sat, 14 Jan 2017 08:22:50 -0800 Subject: [PATCH] traffic-control: (fixes #2617) PfifoFastQueueDisc::Peek all bands --- src/traffic-control/model/pfifo-fast-queue-disc.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/traffic-control/model/pfifo-fast-queue-disc.cc b/src/traffic-control/model/pfifo-fast-queue-disc.cc index b2bbf9258..ccfe7d717 100644 --- a/src/traffic-control/model/pfifo-fast-queue-disc.cc +++ b/src/traffic-control/model/pfifo-fast-queue-disc.cc @@ -121,10 +121,12 @@ PfifoFastQueueDisc::DoPeek (void) const for (uint32_t i = 0; i < GetNInternalQueues (); i++) { - item = StaticCast (GetInternalQueue (i)->Peek ()); - NS_LOG_LOGIC ("Peeked from band " << i << ": " << item); - NS_LOG_LOGIC ("Number packets band " << i << ": " << GetInternalQueue (i)->GetNPackets ()); - return item; + if ((item = StaticCast (GetInternalQueue (i)->Peek ())) != 0) + { + NS_LOG_LOGIC ("Peeked from band " << i << ": " << item); + NS_LOG_LOGIC ("Number packets band " << i << ": " << GetInternalQueue (i)->GetNPackets ()); + return item; + } } NS_LOG_LOGIC ("Queue empty");