Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't override ARES_OPT_DOMAINS with the values in resolv.conf #5

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions ares_init.c
Expand Up @@ -853,6 +853,12 @@ DhcpNameServer
FILE *fp;
size_t linesize;
int error;

int ignore_domains = 0;

/* Don't override ARES_OPT_DOMAINS */
if (channel->ndomains != -1)
ignore_domains = 1;

/* Don't read resolv.conf and friends if we don't have to */
if (ARES_CONFIG_CHECK(channel))
Expand All @@ -862,11 +868,11 @@ DhcpNameServer
if (fp) {
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
{
if ((p = try_config(line, "domain", ';')))
if ((p = try_config(line, "domain", ';')) && !ignore_domains)
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", ';')) && !ignore_domains)
status = set_search(channel, p);
else if ((p = try_config(line, "nameserver", ';')) &&
channel->nservers == -1)
Expand Down