src/aodv/model/aodv-routing-protocol.cc
changeset 7160 4082270126b5
parent 7159 009cd4e1b486
child 7165 7f8040a1d8bc
--- a/src/aodv/model/aodv-routing-protocol.cc	Thu May 12 23:10:46 2011 -0700
+++ b/src/aodv/model/aodv-routing-protocol.cc	Thu May 12 23:14:54 2011 -0700
@@ -947,11 +947,14 @@
   RoutingTableEntry rt;
   if (m_routingTable.LookupRoute (addr, rt))
     {
-      rt.SetFlag (VALID);
-      rt.SetRreqCnt (0);
-      rt.SetLifeTime (std::max (lifetime, rt.GetLifeTime ()));
-      m_routingTable.Update (rt);
-      return true;
+      if (rt.GetFlag () == VALID)
+        {
+          NS_LOG_DEBUG ("Updating VALID route");
+          rt.SetRreqCnt (0);
+          rt.SetLifeTime (std::max (lifetime, rt.GetLifeTime ()));
+          m_routingTable.Update (rt);
+          return true;
+        }
     }
   return false;
 }