summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-conf.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-01 17:03:28 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-01 18:10:01 +0200
commit5cb36f41f01cf4b1f4395abfffd1b33116591e58 (patch)
tree1b8b7e319ce4d7d3ea94a3e84aa9e41723270faa /src/resolve/resolved-conf.c
parentafe7fd56f5b5b81294dcb794214f97fc5e39dfea (diff)
resolved: read the system /etc/resolv.conf unless we wrote it ourselves
This way we integrate nicely with foreign network management stacks, such as NM.
Diffstat (limited to 'src/resolve/resolved-conf.c')
-rw-r--r--src/resolve/resolved-conf.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c
index 0def80e3a5..ae3773f4f7 100644
--- a/src/resolve/resolved-conf.c
+++ b/src/resolve/resolved-conf.c
@@ -94,20 +94,27 @@ int config_parse_dnsv(
else
l = &m->dns_servers;
- /* Empty assignment means clear the list */
if (isempty(rvalue)) {
+
+ /* Empty assignment means clear the list */
while (*l)
dns_server_free(*l);
- return 0;
- }
+ } else {
- r = manager_parse_dns_server(m, ltype, rvalue);
- if (r < 0) {
- log_syntax(unit, LOG_ERR, filename, line, -r, "Failed to parse DNS server string '%s'. Ignoring.", rvalue);
- return 0;
+ /* Otherwise add to the list */
+ r = manager_parse_dns_server(m, ltype, rvalue);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, -r, "Failed to parse DNS server string '%s'. Ignoring.", rvalue);
+ return 0;
+ }
}
+ /* If we have a manual setting, then we stop reading
+ * /etc/resolv.conf */
+ if (ltype == DNS_SERVER_SYSTEM)
+ m->read_resolv_conf = false;
+
return 0;
}