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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user