bug 1097: AODV routing entry set to be VALID mistakenly (reported by Yang Chi)
authorTom Henderson <tomh@tomh.org>
Thu, 12 May 2011 23:14:54 -0700
changeset 7160 4082270126b5
parent 7159 009cd4e1b486
child 7161 7cc4506fb853
bug 1097: AODV routing entry set to be VALID mistakenly (reported by Yang Chi)
RELEASE_NOTES
src/aodv/model/aodv-routing-protocol.cc
--- a/RELEASE_NOTES	Thu May 12 23:10:46 2011 -0700
+++ b/RELEASE_NOTES	Thu May 12 23:14:54 2011 -0700
@@ -76,6 +76,7 @@
    - bug 1058 - documentation help to avoid InternetStackHelper pitfall
    - bug 1054 - ipv6 InternetStackHelper EnablePcapIpv6All() broken
    - bug 1042 - AODV RERR implosion (missing RERR_RATELIMIT) 
+   - bug 1097 - AODV routing entry set to be VALID mistakenly
 
 Known issues
 ------------
--- 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;
 }