aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-11-22 22:54:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-11-22 22:54:41 +0000
commit04d5d1895cb90ddc3dada1b64d48c75d26d4f84e (patch)
treeab3839f2551d7f4d9449667488dfe53902b28c00
parentabd2775a70688cd609d6978376ac0a8809f18db5 (diff)
Michael Wallner fixed this problem: 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.
-rw-r--r--ares/CHANGES4
-rw-r--r--ares/ares_init.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ares/CHANGES b/ares/CHANGES
index fe2fd6a08..bfe2e4aed 100644
--- a/ares/CHANGES
+++ b/ares/CHANGES
@@ -4,6 +4,10 @@
- Install ares_dns.h too
+- Michael Wallner fixed this problem: 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.
+
* November 6
- Yang Tse removed a couple of potential zero size memory allocations.
diff --git a/ares/ares_init.c b/ares/ares_init.c
index 7246bc484..e32633fde 100644
--- a/ares/ares_init.c
+++ b/ares/ares_init.c
@@ -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);