[Dnsmasq-discuss] Announce: dnsmasq-2.38

Jan 'RedBully' Seiffert redbully at cc.fh-luh.de
Mon Feb 12 21:52:16 GMT 2007


Simon Kelley wrote:
> Dennis Veatch wrote:
>> On Monday 12 February 2007 03:50:07 pm Simon Kelley wrote:
>>
>>> In an attempt to increase the average release-rate after the long gap
>>> over christmas, I've released dnsmasq 2.38. :-)
>>>
>>> Seriously, this fixes a problem introduced in 2.37 which can cause
>>> dnsmasq to hang, using 100% CPU. It's not clear how likely it is for
>>> this bug to occur in reality: I've had exactly one report. I think that
>>> at least one infinite-time DHCP lease must exist before the problem
>>> occurs, and I suspect that other conditions are also required.
>>>
>>
>>
>> Ohhh, so that's what I have been experiencing. :)
>> I wondered what the heck was going on cause nothing was showing up in
>> the logs.
>>
> 
> Correction: I've had exactly two reports!
> 
> 
> For giggles, the faulty code was:
> 
>     if (crecp->flags & F_IMMORTAL)
>         while (*up && (!(*up)->flags & F_IMMORTAL))
>           up = &((*up)->hash_next);
> 
> which should, (of course) have been:
> 
>     if (crecp->flags & F_IMMORTAL)
>         while (*up && !((*up)->flags & F_IMMORTAL))
>           up = &((*up)->hash_next);
> 

/me blinks
Ouch
/me wonders why i don't hit this, i have mostly unlimited leases..

C: You shoot yourself in the foot

Just to enlighten me a little bit:

> @@ -282,9 +282,7 @@ static int cache_scan_free(char *name, s
> 
>    if (flags & F_FORWARD)
>      {
> -      for (up = hash_bucket(name), crecp = *up;
> -          crecp && ((crecp->flags & F_REVERSE) || !(crecp->flags & F_IMMORTAL));
> -          crecp = crecp->hash_next)
> +      for (up = hash_bucket(name), crecp = *up; crecp; crecp = crecp->hash_next)
>         if (is_expired(now, crecp) || is_outdated_cname_pointer(crecp))
>           {
>             *up = crecp->hash_next;

Hmmm, ok, when scanning for F_FORWARD entries testing for F_REVERSE is,
uhm, wrong.

But with the F_IMMORTAL, is an unlimited dhcp-lease also immortal and
not at the end of a chain? So we can't stop scanning when seeing
immortals, which we cannot free, because there are still scan-/free-able
entries behind it? Hmmm, probably, its F_REVERSE and at the front.
/me needs to send some SIGUSR1...

> Cheers,
> 
> Simon.
> 
Greetings
	Jan


-- 
Live proud, live free - code in C



More information about the Dnsmasq-discuss mailing list