diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc index 3315f89c6..b756e543d 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -508,7 +508,7 @@ HwmpProtocol::ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, M //we have got from PREQ, and set the rest lifetime of the //route if the information is correct uint32_t lifetime = result.lifetime.GetMicroSeconds () / 1024; - if (lifetime > 0) + if ((lifetime > 0) && (result.seqnum >= (*i)->GetDestSeqNumber ())) { SendPrep ( (*i)->GetDestinationAddress (), @@ -516,19 +516,19 @@ HwmpProtocol::ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, M from, result.metric, preq.GetOriginatorSeqNumber (), - result.seqnum +1, + result.seqnum, lifetime, interface ); - } - if ((*i)->IsRf ()) - { - (*i)->SetFlags (true, false, (*i)->IsUsn ()); //DO = 1, RF = 0 - } - else - { - preq.DelDestinationAddressElement ((*i)->GetDestinationAddress ()); - continue; + if ((*i)->IsRf ()) + { + (*i)->SetFlags (true, false, (*i)->IsUsn ()); //DO = 1, RF = 0 + } + else + { + preq.DelDestinationAddressElement ((*i)->GetDestinationAddress ()); + continue; + } } } } @@ -982,11 +982,7 @@ HwmpProtocol::RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry) return; } uint32_t originator_seqno = GetNextHwmpSeqno (); - uint32_t dst_seqno = 0; - if (result.retransmitter != Mac48Address::GetBroadcast ()) - { - dst_seqno = result.seqnum; - } + uint32_t dst_seqno = m_rtable->LookupReactiveExpired (dst).seqnum; for (HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++) { i->second->RequestDestination (dst, originator_seqno, dst_seqno); diff --git a/src/devices/mesh/dot11s/ie-dot11s-preq.cc b/src/devices/mesh/dot11s/ie-dot11s-preq.cc index 049b5e822..e4c8c41e9 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-preq.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-preq.cc @@ -355,7 +355,7 @@ IePreq::AddDestinationAddressElement (bool doFlag, bool rfFlag, Mac48Address des } //TODO: check overflow Ptr new_element = Create (); - new_element->SetFlags (doFlag, rfFlag, false); + new_element->SetFlags (doFlag, rfFlag, (dest_seq_number == 0)); new_element->SetDestinationAddress (dest_address); new_element->SetDestSeqNumber (dest_seq_number); m_destinations.push_back (new_element); diff --git a/src/devices/mesh/mesh-wifi-interface-mac.cc b/src/devices/mesh/mesh-wifi-interface-mac.cc index 6f4c4d34a..ab7fc2810 100644 --- a/src/devices/mesh/mesh-wifi-interface-mac.cc +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc @@ -399,8 +399,7 @@ MeshWifiInterfaceMac::SendManagementFrame (Ptr packet, const WifiMacHead } m_stats.sentFrames++; m_stats.sentBytes += packet->GetSize (); - Queues::iterator i = m_queues.find (AC_VO); - if (i == m_queues.end ()) + if (m_queues.find (AC_VO) == m_queues.end ()) { NS_FATAL_ERROR ("Voice queue is not set up!"); } @@ -654,8 +653,7 @@ MeshWifiInterfaceMac::ResetStats () void MeshWifiInterfaceMac::SetQueue (Ptr queue, AccessClass ac) { - Queues::iterator i = m_queues.find (ac); - if (i != m_queues.end ()) + if (m_queues.find (ac) != m_queues.end ()) { NS_LOG_WARN ("Queue is already set!"); return; @@ -667,7 +665,7 @@ MeshWifiInterfaceMac::SetQueue (Ptr queue, AccessClass ac) Ptr MeshWifiInterfaceMac::GetQueue (AccessClass ac) { - Queues::iterator i = m_queues.find (ac); + Queues::const_iterator i = m_queues.find (ac); if (i != m_queues.end ()) { NS_LOG_WARN ("Queue is not found! Check access class!");