Bug 1020 - Wrong usage of the originator sequence number in HWMP PREP: fixed
authorKirill Andreev <andreev@telum.ru>
Mon, 12 Dec 2011 19:00:45 +0300
changeset 7631 ddd352da5c13
parent 7630 efcbdf6d3dc5
child 7632 82d41b1a365a
Bug 1020 - Wrong usage of the originator sequence number in HWMP PREP: fixed
src/mesh/model/dot11s/hwmp-protocol.cc
--- a/src/mesh/model/dot11s/hwmp-protocol.cc	Mon Dec 12 18:40:41 2011 +0300
+++ b/src/mesh/model/dot11s/hwmp-protocol.cc	Mon Dec 12 19:00:45 2011 +0300
@@ -565,18 +565,19 @@
   std::map<Mac48Address, std::pair<uint32_t, uint32_t> >::const_iterator i = m_hwmpSeqnoMetricDatabase.find (
       prep.GetOriginatorAddress ());
   bool freshInfo (true);
+  uint32_t sequence = prep.GetDestinationSeqNumber ();
   if (i != m_hwmpSeqnoMetricDatabase.end ())
     {
-      if ((int32_t)(i->second.first - prep.GetOriginatorSeqNumber ()) > 0)
+      if ((int32_t)(i->second.first - sequence) > 0)
         {
           return;
         }
-      if (i->second.first == prep.GetOriginatorSeqNumber ())
+      if (i->second.first == sequence)
         {
           freshInfo = false;
         }
     }
-  m_hwmpSeqnoMetricDatabase[prep.GetOriginatorAddress ()] = std::make_pair (prep.GetOriginatorSeqNumber (), prep.GetMetric ());
+  m_hwmpSeqnoMetricDatabase[prep.GetOriginatorAddress ()] = std::make_pair (sequence, prep.GetMetric ());
   //update routing info
   //Now add a path to destination and add precursor to source
   NS_LOG_DEBUG ("I am " << GetAddress () << ", received prep from " << prep.GetOriginatorAddress () << ", receiver was:" << from);
@@ -597,7 +598,7 @@
         interface,
         prep.GetMetric (),
         MicroSeconds (prep.GetLifetime () * 1024),
-        prep.GetOriginatorSeqNumber ());
+        sequence);
       m_rtable->AddPrecursor (prep.GetDestinationAddress (), interface, from,
                               MicroSeconds (prep.GetLifetime () * 1024));
       if (result.retransmitter != Mac48Address::GetBroadcast ())
@@ -618,7 +619,7 @@
         interface,
         metric,
         MicroSeconds (prep.GetLifetime () * 1024),
-        prep.GetOriginatorSeqNumber ());
+        sequence);
       ReactivePathResolved (fromMp);
     }
   if (prep.GetDestinationAddress () == GetAddress ())