Mesh: HWMP: fixed proactive routes
authorKirill Andreev <andreev@iitp.ru>
Thu, 29 Oct 2009 15:39:41 +0300
changeset 5469 3d1c26170e5c
parent 5468 6eebad1fb54d
child 5470 d3aabb63dd12
Mesh: HWMP: fixed proactive routes
src/devices/mesh/dot11s/hwmp-protocol.cc
--- a/src/devices/mesh/dot11s/hwmp-protocol.cc	Thu Oct 29 11:12:12 2009 +0000
+++ b/src/devices/mesh/dot11s/hwmp-protocol.cc	Thu Oct 29 15:39:41 2009 +0300
@@ -320,7 +320,7 @@
 {
   NS_ASSERT(destination != Mac48Address::GetBroadcast ());
   HwmpRtable::LookupResult result = m_rtable->LookupReactive (destination);
-  NS_LOG_DEBUG("Requested src = "<<source<<", dst = "<<destination<<", I am "<<GetAddress ()<<", RA = "<<result.retransmitter);
+  NS_LOG_DEBUG ("Requested src = "<<source<<", dst = "<<destination<<", I am "<<GetAddress ()<<", RA = "<<result.retransmitter);
   if (result.retransmitter == Mac48Address::GetBroadcast ())
     {
       result = m_rtable->LookupProactive ();
@@ -477,6 +477,15 @@
                   preq.GetOriginatorSeqNumber ()
                   );
               ProactivePathResolved ();
+              m_rtable->AddReactivePath (
+                  preq.GetOriginatorAddress (),
+                  from,
+                  interface,
+                  preq.GetMetric (),
+                  MicroSeconds (preq.GetLifetime () * 1024),
+                  preq.GetOriginatorSeqNumber ()
+                  );
+              ReactivePathResolved (preq.GetOriginatorAddress ());
             }
           if (!preq.IsNeedNotPrep ())
             {
@@ -611,11 +620,6 @@
     }
   if (result.retransmitter == Mac48Address::GetBroadcast ())
     {
-      //try to look for default route
-      result = m_rtable->LookupProactive ();
-    }
-  if (result.retransmitter == Mac48Address::GetBroadcast ())
-    {
       return;
     }
   //Forward PREP