[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Bug in rtqueue.cc (plus fix)



Hi,

I came across a bug in rtqueue.cc in the rtqueue::purge() method.

Line 148 is

assert(p == remove_head());

This can cause problems when assertion is turned off: the remove_head() method
does not get called. The solution is simply to create a temporary variable in
the method.

Here is what I've modified it to (because of my environment I can't simply
make a patch). I manually copied this from the other (unnetworked) computer on
my desk - it may not compile, but you get the idea.

-----

void
rtqueue::purge()
{
	Packet *p;

	while((p = head_) && (HDR_CMN(p)->ts_ < CURRENT_TIME) {
		Packet *temp = remove_head() ;
		assert (p == temp) ;
		drop (p, DROP_RTR_QTIMEOUT);
	}
}

-----

Regards,
Sean.