resolved: use the fallback servers when no default dns is configured

This expands the role of fallback servers so they are applied not only
when there are no dns servers configured, but when all the configured
dns servers are configured only for non-default-route links.
This commit is contained in:
Ronan Pigott
2024-08-21 09:51:42 -07:00
parent 73e566bf16
commit 760fa203c2
3 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -907,7 +907,7 @@ DnsServer *manager_get_dns_server(Manager *m) {
* servers */
HASHMAP_FOREACH(l, m->links)
if (l->dns_servers) {
if (l->dns_servers && l->default_route) {
found = true;
break;
}
+1 -2
View File
@@ -463,8 +463,7 @@ int bus_link_method_set_default_route(sd_bus_message *message, void *userdata, s
bus_client_log(message, "dns default route change");
if (l->default_route != b) {
l->default_route = b;
link_set_default_route(l, b);
(void) link_save_user(l);
(void) manager_write_resolv_conf(l->manager);
+1 -1
View File
@@ -319,7 +319,7 @@ static int link_update_default_route(Link *l) {
if (r < 0)
goto clear;
l->default_route = r > 0;
link_set_default_route(l, r > 0);
return 0;
clear: