Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 87091 - dnsmasq-2.21 is un-useable on stable servers with dhcp-host option
Summary: dnsmasq-2.21 is un-useable on stable servers with dhcp-host option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Jon Portnoy (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 86718
  Show dependency tree
 
Reported: 2005-03-29 03:38 UTC by Roy Marples (RETIRED)
Modified: 2005-03-31 16:30 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Marples (RETIRED) gentoo-dev 2005-03-29 03:38:48 UTC
dnsmasq-2.21 causes the following issues on my servers

1) Any client matched in dhcp-host for DHCP requests cause dnsmasq to stop responding to DNS and DHCP requests

2) when mx-host, mx-target or localmx options are set, dnsmasq will go into a infinite loop and not fork to the background when it is started

Reverting back to stable 2.15 or unstable 2.20 fixes the above issues.
Comment 1 rob holland (RETIRED) gentoo-dev 2005-03-29 04:26:19 UTC
found the --mx-target= bug, waiting for Uberlord to test my fix.
Comment 2 rob holland (RETIRED) gentoo-dev 2005-03-29 04:42:24 UTC
option.c has:

      if ((daemon->mxtarget || (daemon->options & OPT_LOCALMX)) && !mx)
        {
          daemon->mxnames = safe_malloc(sizeof(struct mx_srv_record));
          daemon->mxnames->next = daemon->mxnames;
          daemon->mxnames->issrv = 0;
          daemon->mxnames->target = NULL;
          daemon->mxnames->name = safe_string_alloc(buff);
        }

and later:

      for (mx = daemon->mxnames; mx; mx = mx->next)
        if (!mx->issrv && !mx->target)
          mx->target = daemon->mxtarget;

This loops forever because mx->next = mx = mx->next as there is no sanity check
for loops (in this case, next=self).

Not quite sure what was meant to happen here, but it seems maybe it should be:

daemon->mxnames->next =  NULL;

instead of

daemon->mxnames->next = daemon->mxnames;

We don't have anyone here who can test this functionality easily, so mailing upstream.
Comment 3 rob holland (RETIRED) gentoo-dev 2005-03-29 05:13:22 UTC
I can't easily pinpoint the dhcp-host bug because I can't test locally and gdb wasn't playing nice on Uberlord's machine.

I'll let Simon know about this bug.
Comment 4 rob holland (RETIRED) gentoo-dev 2005-03-29 05:16:26 UTC
author mailed.
Comment 5 Thierry Carrez (RETIRED) gentoo-dev 2005-03-29 10:49:40 UTC
dnsmasq should probably be masked until resolution
Comment 6 Thierry Carrez (RETIRED) gentoo-dev 2005-03-29 10:51:58 UTC
I mean 2.21 should be masked (or keywords reset) until resolution as 2.21 is the current stable.
Comment 7 rob holland (RETIRED) gentoo-dev 2005-03-29 13:20:06 UTC
uberlord: please test http://www.thekelleys.org.uk/test

It should definitely fix the mx-host thing and hopefully the dhcp-host stuff as well.
Comment 8 Roy Marples (RETIRED) gentoo-dev 2005-03-29 13:53:20 UTC
That test version does NOT fix the dhcp-host problem :(
If it helps, here is a line that causes the problem

dhcp-host=00:09:5b:84:88:7d,uberpc,192.168.2.10

Removing that line makes uberpc get a DHCP address correctly and not cause dnsmasq to eat CPU cycles like it's going out of fashion.
Comment 9 Jon Portnoy (RETIRED) gentoo-dev 2005-03-29 15:41:13 UTC
Bug is more harmful than potential security problems in <=2.20. I've masked 2.21 for now.
Comment 10 Roy Marples (RETIRED) gentoo-dev 2005-03-30 02:26:53 UTC
The 2.22 test version in comment #7 fixed the mx bug

Just the dhcp-host bug to fix now!
Comment 11 rob holland (RETIRED) gentoo-dev 2005-03-30 07:31:18 UTC
the dhc-host bug manifests itself at dhcp.c:422

  for (; context; context = context->current)

loops forever. This is another context == context->current thing, same as last one.

Not sure of the fix but I've let the author know.
Comment 12 rob holland (RETIRED) gentoo-dev 2005-03-31 07:10:44 UTC
test fix version from simon at:

http://thekelleys.org.uk/test/dnsmasq-2.22test7.tar.gz
Comment 13 Roy Marples (RETIRED) gentoo-dev 2005-03-31 08:07:48 UTC
fix confirmed to work :)
Comment 14 rob holland (RETIRED) gentoo-dev 2005-03-31 08:22:19 UTC
I've let the author know.
Comment 15 rob holland (RETIRED) gentoo-dev 2005-03-31 09:18:01 UTC
22 released with the fix.
Comment 16 Jon Portnoy (RETIRED) gentoo-dev 2005-03-31 16:30:46 UTC
2.22 committed. Thanks Rob!