summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-link.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-01 18:09:07 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-01 18:10:01 +0200
commit2c27fbca2d88214bd305272308a370a962818f1e (patch)
treeae09b9ca13041c3eab777c1dd596e4224a879385 /src/resolve/resolved-link.c
parent5cb36f41f01cf4b1f4395abfffd1b33116591e58 (diff)
resolved: flush cache each time we change to a different DNS server
Diffstat (limited to 'src/resolve/resolved-link.c')
-rw-r--r--src/resolve/resolved-link.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 7418ea1ed9..2c02f09473 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -248,7 +248,7 @@ DnsServer* link_find_dns_server(Link *l, int family, const union in_addr_union *
return NULL;
}
-static DnsServer* link_set_dns_server(Link *l, DnsServer *s) {
+DnsServer* link_set_dns_server(Link *l, DnsServer *s) {
assert(l);
if (l->current_dns_server == s)
@@ -259,10 +259,13 @@ static DnsServer* link_set_dns_server(Link *l, DnsServer *s) {
in_addr_to_string(s->family, &s->address, &ip);
log_info("Switching to DNS server %s for interface %s.", strna(ip), l->name);
- } else
- log_info("No DNS server set for interface %s.", l->name);
+ }
l->current_dns_server = s;
+
+ if (l->unicast_scope)
+ dns_cache_flush(&l->unicast_scope->cache);
+
return s;
}