3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 10:39:23 +01:00

resolve: Handle empty dns/domain lists

In the strange case that the dns list or the domain list are empty and
openresolv is being used, delete the openresolv entry instance instead
of trying to set it to an empty value
This commit is contained in:
Denis Kenzior 2020-12-02 10:57:57 -06:00
parent b647f8e1f0
commit 967b7e75e3

View File

@ -406,6 +406,14 @@ static void resolve_resolvconf_set_dns(struct resolve *resolve, char **dns_list)
if (L_WARN_ON(!resolvconf_path)) if (L_WARN_ON(!resolvconf_path))
return; return;
if (!dns_list || !dns_list[0]) {
if (rc->have_dns)
resolvconf_invoke(rc->ifname, "dns", NULL);
rc->have_dns = false;
return;
}
content = l_string_new(0); content = l_string_new(0);
for (; *dns_list; dns_list++) for (; *dns_list; dns_list++)
@ -428,6 +436,14 @@ static void resolve_resolvconf_set_domains(struct resolve *resolve,
if (L_WARN_ON(!resolvconf_path)) if (L_WARN_ON(!resolvconf_path))
return; return;
if (!domain_list || !domain_list[0]) {
if (rc->have_domain)
resolvconf_invoke(rc->ifname, "domain", NULL);
rc->have_domain = false;
return;
}
content = l_string_new(0); content = l_string_new(0);
for (; *domain_list; domain_list++) for (; *domain_list; domain_list++)