From f173b434dd2fb2c349da7a057877caad9caf6df7 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 29 May 2008 09:01:31 -0700 Subject: [PATCH] DequeuePending returns 0 upon error, not the other way round. --- src/internet-node/arp-l3-protocol.cc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/internet-node/arp-l3-protocol.cc b/src/internet-node/arp-l3-protocol.cc index 784984d48..bd27ce7c6 100644 --- a/src/internet-node/arp-l3-protocol.cc +++ b/src/internet-node/arp-l3-protocol.cc @@ -155,15 +155,12 @@ ArpL3Protocol::Receive(Ptr device, Ptr packet, uint16_t proto << " for waiting entry -- flush"); Address from_mac = arp.GetSourceHardwareAddress (); entry->MarkAlive (from_mac); - while (true) + Ptr pending = entry->DequeuePending(); + while (pending != 0) { - Ptr pending = entry->DequeuePending(); - if (pending != 0) - { - break; - } cache->GetInterface ()->Send (pending, arp.GetSourceIpv4Address ()); + pending = entry->DequeuePending(); } } else @@ -220,14 +217,11 @@ ArpL3Protocol::Lookup (Ptr packet, Ipv4Address destination, NS_LOG_LOGIC ("node="<GetId ()<< ", wait reply for " << destination << " expired -- drop"); entry->MarkDead (); - while (true) + Ptr pending = entry->DequeuePending(); + while (pending != 0) { - Ptr pending = entry->DequeuePending(); - if (pending != 0) - { - break; - } m_dropTrace (pending); + pending = entry->DequeuePending(); } m_dropTrace (packet); }