Bug 1932 - NdiscCache entry is not failsafe on double neighbor probing

This commit is contained in:
Tommaso Pecorella
2014-06-17 23:31:52 +02:00
parent 69d284bc83
commit b7a3cff456
3 changed files with 18 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ New user-visible features
Bugs fixed
----------
- Bug 1930 - Use of invalid reference in OLSR RemoveLinkTuple
- Bug 1932 - NdiscCache entry is not failsafe on double neighbor probing.
Known issues
------------

View File

@@ -1340,7 +1340,7 @@ bool Icmpv6L4Protocol::Lookup (Ptr<Packet> p, Ipv6Address dst, Ptr<NetDevice> de
*hardwareDestination = entry->GetMacAddress ();
return true;
}
else /* PROBE */
else /* INCOMPLETE or PROBE */
{
/* queue packet */
entry->AddWaitingPacket (p);

View File

@@ -367,6 +367,10 @@ void NdiscCache::Entry::UpdateLastReachabilityconfirmation ()
void NdiscCache::Entry::StartReachableTimer ()
{
NS_LOG_FUNCTION_NOARGS ();
if (m_reachableTimer.IsRunning ())
{
m_reachableTimer.Cancel ();
}
m_reachableTimer.SetFunction (&NdiscCache::Entry::FunctionReachableTimeout, this);
m_reachableTimer.SetDelay (MilliSeconds (Icmpv6L4Protocol::REACHABLE_TIME));
m_reachableTimer.Schedule ();
@@ -381,6 +385,10 @@ void NdiscCache::Entry::StopReachableTimer ()
void NdiscCache::Entry::StartProbeTimer ()
{
NS_LOG_FUNCTION_NOARGS ();
if (m_probeTimer.IsRunning ())
{
m_probeTimer.Cancel ();
}
m_probeTimer.SetFunction (&NdiscCache::Entry::FunctionProbeTimeout, this);
m_probeTimer.SetDelay (MilliSeconds (Icmpv6L4Protocol::RETRANS_TIMER));
m_probeTimer.Schedule ();
@@ -397,6 +405,10 @@ void NdiscCache::Entry::StopProbeTimer ()
void NdiscCache::Entry::StartDelayTimer ()
{
NS_LOG_FUNCTION_NOARGS ();
if (m_delayTimer.IsRunning ())
{
m_delayTimer.Cancel ();
}
m_delayTimer.SetFunction (&NdiscCache::Entry::FunctionDelayTimeout, this);
m_delayTimer.SetDelay (Seconds (Icmpv6L4Protocol::DELAY_FIRST_PROBE_TIME));
m_delayTimer.Schedule ();
@@ -412,6 +424,10 @@ void NdiscCache::Entry::StopDelayTimer ()
void NdiscCache::Entry::StartRetransmitTimer ()
{
NS_LOG_FUNCTION_NOARGS ();
if (m_retransTimer.IsRunning ())
{
m_retransTimer.Cancel ();
}
m_retransTimer.SetFunction (&NdiscCache::Entry::FunctionRetransmitTimeout, this);
m_retransTimer.SetDelay (MilliSeconds (Icmpv6L4Protocol::RETRANS_TIMER));
m_retransTimer.Schedule ();