From 9e1dd179fca252dae382b0c7e20779adefef7af6 Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Thu, 2 Jun 2011 19:45:03 +0400 Subject: [PATCH] Mesh: Bug 1033 - airtime-metric: fixed --- src/mesh/model/dot11s/airtime-metric.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesh/model/dot11s/airtime-metric.cc b/src/mesh/model/dot11s/airtime-metric.cc index 86e81833d..747622223 100644 --- a/src/mesh/model/dot11s/airtime-metric.cc +++ b/src/mesh/model/dot11s/airtime-metric.cc @@ -89,6 +89,11 @@ AirtimeLinkMetricCalculator::CalculateMetric (Mac48Address peerAddress, PtrGetWifiRemoteStationManager ()->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*/