From 720f567e6b9411d37d4bec16a38cfaed9f2658a2 Mon Sep 17 00:00:00 2001 From: John Abraham Date: Thu, 30 Jun 2011 11:35:15 -0400 Subject: [PATCH] Bug 1193 - Hello timers scheduling skewed when RREP, RREQ are processed --- src/aodv/model/aodv-routing-protocol.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/aodv/model/aodv-routing-protocol.cc b/src/aodv/model/aodv-routing-protocol.cc index 23a952921..bcb0df7c9 100644 --- a/src/aodv/model/aodv-routing-protocol.cc +++ b/src/aodv/model/aodv-routing-protocol.cc @@ -873,8 +873,11 @@ RoutingProtocol::SendRequest (Ipv4Address dst) ScheduleRreqRetry (dst); if (EnableHello) { - m_htimer.Cancel (); - m_htimer.Schedule (HelloInterval - Time (0.01 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + if (!m_htimer.IsRunning ()) + { + m_htimer.Cancel (); + m_htimer.Schedule (HelloInterval - Time (0.01 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + } } } @@ -1137,8 +1140,11 @@ RoutingProtocol::RecvRequest (Ptr p, Ipv4Address receiver, Ipv4Address s if (EnableHello) { - m_htimer.Cancel (); - m_htimer.Schedule (HelloInterval - Time (0.1 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + if (!m_htimer.IsRunning ()) + { + m_htimer.Cancel (); + m_htimer.Schedule (HelloInterval - Time (0.1 * MilliSeconds (UniformVariable ().GetInteger (0, 10)))); + } } }