# HG changeset patch # User Kirill Andreev # Date 1248341991 -14400 # Node ID 26472734b69ff8ed93061b3a48eabd358d9d558c # Parent 1e44b8fa74cdcab35e1f1a1d49b96d863b8e98bb Fixed seqno in HWMP diff -r 1e44b8fa74cd -r 26472734b69f src/devices/mesh/dot11s/hwmp-protocol.cc --- a/src/devices/mesh/dot11s/hwmp-protocol.cc Wed Jul 22 16:57:12 2009 +0400 +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc Thu Jul 23 13:39:51 2009 +0400 @@ -508,7 +508,7 @@ //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 @@ 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 @@ 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 -r 1e44b8fa74cd -r 26472734b69f src/devices/mesh/dot11s/ie-dot11s-preq.cc --- a/src/devices/mesh/dot11s/ie-dot11s-preq.cc Wed Jul 22 16:57:12 2009 +0400 +++ b/src/devices/mesh/dot11s/ie-dot11s-preq.cc Thu Jul 23 13:39:51 2009 +0400 @@ -355,7 +355,7 @@ } //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 -r 1e44b8fa74cd -r 26472734b69f src/devices/mesh/mesh-wifi-interface-mac.cc --- a/src/devices/mesh/mesh-wifi-interface-mac.cc Wed Jul 22 16:57:12 2009 +0400 +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc Thu Jul 23 13:39:51 2009 +0400 @@ -399,8 +399,7 @@ } 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 @@ 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 @@ 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!");