From 2a487f82029cac0bb551ff171cbd9cff586a8d50 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 30 Oct 2008 22:04:12 -0700 Subject: [PATCH] Fix bug 362; cancel WaitReplyTimer when ArpCache is flushed --- src/internet-stack/arp-cache.cc | 5 +++++ src/internet-stack/arp-l3-protocol.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/internet-stack/arp-cache.cc b/src/internet-stack/arp-cache.cc index 4da9c4091..cf6a15bf4 100644 --- a/src/internet-stack/arp-cache.cc +++ b/src/internet-stack/arp-cache.cc @@ -232,6 +232,11 @@ ArpCache::Flush (void) delete (*i).second; } m_arpCache.erase (m_arpCache.begin (), m_arpCache.end ()); + if (m_waitReplyTimer.IsRunning ()) + { + NS_LOG_LOGIC ("Stopping WaitReplyTimer at " << Simulator::Now ().GetSeconds () << " due to ArpCache flush"); + m_waitReplyTimer.Cancel (); + } } ArpCache::Entry * diff --git a/src/internet-stack/arp-l3-protocol.cc b/src/internet-stack/arp-l3-protocol.cc index e99d233d0..0b8c60cf8 100644 --- a/src/internet-stack/arp-l3-protocol.cc +++ b/src/internet-stack/arp-l3-protocol.cc @@ -221,7 +221,7 @@ ArpL3Protocol::Lookup (Ptr packet, Ipv4Address destination, } else if (entry->IsWaitReply ()) { - NS_FATAL_ERROR ("Test for possibly unreachable code-- please file a bug report if this is ever hit"); + NS_FATAL_ERROR ("Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit"); } } else