mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 02:19:26 +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:
parent
b647f8e1f0
commit
967b7e75e3
@ -406,6 +406,14 @@ static void resolve_resolvconf_set_dns(struct resolve *resolve, char **dns_list)
|
||||
if (L_WARN_ON(!resolvconf_path))
|
||||
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);
|
||||
|
||||
for (; *dns_list; dns_list++)
|
||||
@ -428,6 +436,14 @@ static void resolve_resolvconf_set_domains(struct resolve *resolve,
|
||||
if (L_WARN_ON(!resolvconf_path))
|
||||
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);
|
||||
|
||||
for (; *domain_list; domain_list++)
|
||||
|
Loading…
Reference in New Issue
Block a user