summaryrefslogtreecommitdiff
path: root/src/timesync
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-06 12:33:43 +0200
committerLennart Poettering <lennart@poettering.net>2014-05-06 12:34:37 +0200
commit05f7fc0fe3b65cb203bf1e32002db07d860767b5 (patch)
tree3cae8c8442c1db6d2796851de36b581afec579ce /src/timesync
parent136aa3b444ab5025ebb265b056c5c7ef55688774 (diff)
downloadsystemd-05f7fc0fe3b65cb203bf1e32002db07d860767b5.tar.gz
timesyncd: make sure to reread /etc/resolv.conf when we try the next NTP server
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/timesyncd.c5
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));