Mesh: Bug 1033 - airtime-metric: fixed
authorKirill Andreev <andreev@telum.ru>
Thu, 02 Jun 2011 19:45:03 +0400
changeset 7298 46338d126f2f
parent 7297 e552e9840a14
child 7299 5b13afb6474f
Mesh: Bug 1033 - airtime-metric: fixed
src/mesh/model/dot11s/airtime-metric.cc
--- a/src/mesh/model/dot11s/airtime-metric.cc	Wed Jun 01 17:01:55 2011 -0700
+++ b/src/mesh/model/dot11s/airtime-metric.cc	Thu Jun 02 19:45:03 2011 +0400
@@ -89,6 +89,11 @@
   WifiMode mode = mac->GetWifiRemoteStationManager ()->GetDataMode (peerAddress, &m_testHeader, m_testFrame, m_testFrame->GetSize ());
   //obtain frame error rate:
   double failAvg = mac->GetWifiRemoteStationManager ()->GetInfo (peerAddress).GetFrameErrorRate ();
+  if (failAvg == 1)
+    {
+      // Retrun max metric value when frame error rate equals to 1
+      return (uint32_t)0xffffffff;
+    }
   NS_ASSERT (failAvg < 1.0);
   //calculate metric
   uint32_t metric = (uint32_t)((double)( /*Overhead + payload*/