diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-10-07 23:38:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 23:38:03 +0200 |
commit | 3157b2d9d25e359b0771ecbe1a6c866de141a800 (patch) | |
tree | f64f524b36d4796ca3ed55f2f50bc87e4d651db1 /src/resolve/resolved-dns-stub.c | |
parent | f767d3de652ec18c84ff0b99b1c4430269501e51 (diff) | |
parent | 1ae43295751fc235e7f93719a635a5b06f3ac09b (diff) |
Merge pull request #4061 from dm0-/coreos-1545
resolved: add an option to disable the stub resolver
Diffstat (limited to 'src/resolve/resolved-dns-stub.c')
-rw-r--r-- | src/resolve/resolved-dns-stub.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c index d263cedcd9..53772535c6 100644 --- a/src/resolve/resolved-dns-stub.c +++ b/src/resolve/resolved-dns-stub.c @@ -540,17 +540,21 @@ int manager_dns_stub_start(Manager *m) { assert(m); - r = manager_dns_stub_udp_fd(m); - if (r == -EADDRINUSE) - goto eaddrinuse; - if (r < 0) - return r; + if (IN_SET(m->dns_stub_listener_mode, DNS_STUB_LISTENER_YES, DNS_STUB_LISTENER_UDP)) { + r = manager_dns_stub_udp_fd(m); + if (r == -EADDRINUSE) + goto eaddrinuse; + if (r < 0) + return r; + } - r = manager_dns_stub_tcp_fd(m); - if (r == -EADDRINUSE) - goto eaddrinuse; - if (r < 0) - return r; + if (IN_SET(m->dns_stub_listener_mode, DNS_STUB_LISTENER_YES, DNS_STUB_LISTENER_TCP)) { + r = manager_dns_stub_tcp_fd(m); + if (r == -EADDRINUSE) + goto eaddrinuse; + if (r < 0) + return r; + } return 0; |