diff --git a/src/devices/mesh/dot11s/airtime-metric.cc b/src/devices/mesh/dot11s/airtime-metric.cc index 706591d19..f8dda719e 100644 --- a/src/devices/mesh/dot11s/airtime-metric.cc +++ b/src/devices/mesh/dot11s/airtime-metric.cc @@ -31,7 +31,7 @@ AirtimeLinkMetricCalculator::CalculateMetric(Mac48Address peerAddress, Ptr test_frame = Create (test_length); uint32_t rate = station->GetDataMode(test_frame, test_length+header_length).GetDataRate (); uint32_t payload_nanosec = (uint32_t) ((double) (test_length * 8) * 1e9 / ((double)rate)); - uint32_t metric = (uint32_t) (((double) (payload_nanosec + overhead_nanosec)) / 102.4 * (station->GetAvgSlrc () + 1)); + uint32_t metric = (uint32_t) (((double) (payload_nanosec + overhead_nanosec)) / 10240 * (station->GetAvgSlrc () + 1)); return metric; } } //namespace dot11s diff --git a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc index 7c0c852d3..c29bc9798 100644 --- a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc +++ b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc @@ -64,9 +64,11 @@ HwmpMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) m_stats.recvDataBytes += packet->GetSize (); //TODO: address extension Mac48Address destination; + Mac48Address source; switch (meshHdr.GetAddressExt ()) { case 0: + source = header.GetAddr3 (); destination = header.GetAddr3 (); break; default: @@ -82,7 +84,7 @@ HwmpMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) if(m_protocol->GetAddress() != destination) packet->AddPacketTag(tag); if (destination == Mac48Address::GetBroadcast ()) - if(m_protocol->DropDataFrame (meshHdr.GetMeshSeqno (), header.GetAddr4 ()) ) + if(m_protocol->DropDataFrame (meshHdr.GetMeshSeqno (), source)) return false; } if(header.IsAction()) diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc index ec38f480b..2e6641ccb 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -633,6 +633,8 @@ HwmpProtocol::SetNeighboursCallback(Callback, uint32_t bool HwmpProtocol::DropDataFrame(uint32_t seqno, Mac48Address source) { + if(source == GetAddress ()) + return true; std::map >::const_iterator i = m_lastDataSeqno.find (source); if (i == m_lastDataSeqno.end ()) m_lastDataSeqno[source] = seqno;