summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-server.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-12 19:32:55 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-12 19:32:55 +0200
commit3e684349c2cead2e6fd2f816c34eb17daba23a49 (patch)
treed03a3d7a3491d1462e4693f60d1d8e041806f03d /src/resolve/resolved-dns-server.c
parent96c76ac49c28ba397fc8db3a40505b875c65ef16 (diff)
resolved: unify logic how we flush out DNS servers we learnt
Diffstat (limited to 'src/resolve/resolved-dns-server.c')
-rw-r--r--src/resolve/resolved-dns-server.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c
index 043f6b637d..c99768be4f 100644
--- a/src/resolve/resolved-dns-server.c
+++ b/src/resolve/resolved-dns-server.c
@@ -64,9 +64,9 @@ int dns_server_new(
* we used so far was a fallback one? Then let's try to pick
* the new one */
if (type != DNS_SERVER_FALLBACK &&
- s->manager->current_dns_server &&
- s->manager->current_dns_server->type == DNS_SERVER_FALLBACK)
- manager_set_dns_server(s->manager, NULL);
+ m->current_dns_server &&
+ m->current_dns_server->type == DNS_SERVER_FALLBACK)
+ manager_set_dns_server(m, NULL);
if (ret)
*ret = s;
@@ -87,14 +87,14 @@ DnsServer* dns_server_free(DnsServer *s) {
LIST_REMOVE(servers, s->manager->fallback_dns_servers, s);
else
assert_not_reached("Unknown server type");
+
+ if (s->manager->current_dns_server == s)
+ manager_set_dns_server(s->manager, NULL);
}
if (s->link && s->link->current_dns_server == s)
link_set_dns_server(s->link, NULL);
- if (s->manager && s->manager->current_dns_server == s)
- manager_set_dns_server(s->manager, NULL);
-
free(s);
return NULL;