diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-05-06 12:33:43 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-05-06 12:34:37 +0200 |
commit | 05f7fc0fe3b65cb203bf1e32002db07d860767b5 (patch) | |
tree | 3cae8c8442c1db6d2796851de36b581afec579ce /src/timesync/timesyncd.c | |
parent | 136aa3b444ab5025ebb265b056c5c7ef55688774 (diff) |
timesyncd: make sure to reread /etc/resolv.conf when we try the next NTP server
Diffstat (limited to 'src/timesync/timesyncd.c')
-rw-r--r-- | src/timesync/timesyncd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index 33afbce6b3..1237abb542 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -32,6 +32,7 @@ #include <sys/timerfd.h> #include <sys/timex.h> #include <sys/socket.h> +#include <resolv.h> #include "missing.h" #include "util.h" @@ -913,6 +914,10 @@ static int manager_connect(Manager *m) { m->current_server_name = m->servers; } + /* Tell the resolver to reread /etc/resolv.conf, in + * case it changed. */ + res_init(); + r = sd_resolve_getaddrinfo(m->resolve, &m->resolve_query, m->current_server_name->string, "123", &hints, manager_resolve_handler, m); if (r < 0) { log_error("Failed to create resolver: %s", strerror(-r)); |