Subject: Re: resolv.conv precendence

Re: resolv.conv precendence

From: Michael Wallner <mike_at_iworks.at>
Date: Tue, 07 Nov 2006 14:34:45 +0100

Michael Wallner wrote:
> Hi,
>
> When I set domains in the options struct, and there are domain/search
> entries in /etc/resolv.conf, the domains of the options struct will
> be overridden.

Attached patch makes it work like I would expect, and like
it is documented.

Regards,

-- 
Michael

Index: ares_init.c
===================================================================
RCS file: /cvsroot/curl/curl/ares/ares_init.c,v
retrieving revision 1.41
diff -u -p -d -r1.41 ares_init.c
--- ares_init.c 6 Nov 2006 13:56:51 -0000 1.41
+++ ares_init.c 7 Nov 2006 13:33:13 -0000
@@ -592,11 +592,11 @@ DhcpNameServer
       return (errno == ENOENT) ? ARES_SUCCESS : ARES_EFILE;
     while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
     {
- if ((p = try_config(line, "domain")))
+ if ((p = try_config(line, "domain")) && channel->ndomains == -1)
         status = config_domain(channel, p);
       else if ((p = try_config(line, "lookup")) && !channel->lookups)
         status = config_lookup(channel, p, "bind", "file");
- else if ((p = try_config(line, "search")))
+ else if ((p = try_config(line, "search")) && channel->ndomains == -1)
         status = set_search(channel, p);
       else if ((p = try_config(line, "nameserver")) && channel->nservers == -1)
         status = config_nameserver(&servers, &nservers, p);
Received on 2006-11-07