summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-conf.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-conf.c
parent96c76ac49c28ba397fc8db3a40505b875c65ef16 (diff)
resolved: unify logic how we flush out DNS servers we learnt
Diffstat (limited to 'src/resolve/resolved-conf.c')
-rw-r--r--src/resolve/resolved-conf.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c
index ae3773f4f7..63e87f8df5 100644
--- a/src/resolve/resolved-conf.c
+++ b/src/resolve/resolved-conf.c
@@ -81,7 +81,6 @@ int config_parse_dnsv(
void *userdata) {
Manager *m = userdata;
- DnsServer **l;
int r;
assert(filename);
@@ -89,19 +88,10 @@ int config_parse_dnsv(
assert(rvalue);
assert(m);
- if (ltype == DNS_SERVER_FALLBACK)
- l = &m->fallback_dns_servers;
- else
- l = &m->dns_servers;
-
- if (isempty(rvalue)) {
-
+ if (isempty(rvalue))
/* Empty assignment means clear the list */
- while (*l)
- dns_server_free(*l);
-
- } else {
-
+ manager_flush_dns_servers(m, ltype);
+ else {
/* Otherwise add to the list */
r = manager_parse_dns_server(m, ltype, rvalue);
if (r < 0) {