[Ns-bugs] [Bug 451] Race condition in ARP cache
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Mon Dec 22 06:08:13 PST 2008
http://www.nsnam.org/bugzilla/show_bug.cgi?id=451
--- Comment #4 from Tom Henderson <tomh at tomh.org> 2008-12-22 09:08:13 EDT ---
(In reply to comment #2)
> (In reply to comment #1)
> > (In reply to comment #0)
> >
> > > Suggestions for fixing this? I can see two possible solutions, but I didn't
> > > try either, neither do I have an opinion which one is better:
> > >
> > > 1. remove the assertion and call UpdateWaitReply instead, as if the entry
> > > wasn't expired;
> > >
> > > 2. Change the expiration condition in ArpCache::Entry::IsExpired, use the
> > > expression (delta > timeout) instead of (delta >= timeout).
> > >
> >
> > I looked at your reasoning and agree that is probably what is going on. I
> > would opt for option 2 since the present assertion seems to be helping to find
> > bugs.
> >
> > --- a/src/internet-stack/arp-cache.cc Thu Dec 18 22:33:33 2008 -0800
> > +++ b/src/internet-stack/arp-cache.cc Sun Dec 21 21:37:09 2008 -0800
> > @@ -381,7 +381,7 @@ ArpCache::Entry::IsExpired (void)
> > break;
> > }
> > Time delta = Simulator::Now () - m_lastSeen;
> > - if (delta >= timeout)
> > + if (delta > timeout)
> > {
> > return true;
> > }
> >
>
> Hmm.. on second thought, if we do this then ARP retries might stop working,
> because:
>
> 1. At t=23s HandleWaitReplyTimeout is called;
>
> 2. The expression:
>
> if (entry != 0 && entry->IsWaitReply () && entry->IsExpired ())
>
> fails because entry->IsExpired () will return false.
what about just deleting the test entry->IsExpired () in that statement? I am
not seeing what it adds there.
It seems to me that having to have nearly identical cases "IsExpired()" and
"IsNearlyExpired()" smells like there is probably something wrong with the
state machine logic, and we should fix that instead of resorting to another
method.
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs
mailing list