Fixed seqno in HWMP

This commit is contained in:
Kirill Andreev
2009-07-23 13:39:51 +04:00
parent b153f09d7f
commit 41e7ba85df
3 changed files with 16 additions and 22 deletions

View File

@@ -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);

View File

@@ -355,7 +355,7 @@ IePreq::AddDestinationAddressElement (bool doFlag, bool rfFlag, Mac48Address des
}
//TODO: check overflow
Ptr<DestinationAddressUnit> new_element = Create<DestinationAddressUnit> ();
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);

View File

@@ -399,8 +399,7 @@ MeshWifiInterfaceMac::SendManagementFrame (Ptr<Packet> 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<DcaTxop> 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<DcaTxop> queue, AccessClass ac)
Ptr<DcaTxop>
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!");