aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/ntpd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 4f881eaf9..8f792d16d 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -866,10 +866,8 @@ do_sendto(int fd,
866static void 866static void
867send_query_to_peer(peer_t *p) 867send_query_to_peer(peer_t *p)
868{ 868{
869 if (!p->p_lsa) { 869 if (!p->p_lsa)
870 if (!resolve_peer_hostname(p)) 870 return;
871 return;
872 }
873 871
874 /* Why do we need to bind()? 872 /* Why do we need to bind()?
875 * See what happens when we don't bind: 873 * See what happens when we don't bind:
@@ -2360,6 +2358,14 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
2360 int nfds, timeout; 2358 int nfds, timeout;
2361 double nextaction; 2359 double nextaction;
2362 2360
2361 /* Resolve peer names to IPs, if not resolved yet */
2362 for (item = G.ntp_peers; item != NULL; item = item->link) {
2363 peer_t *p = (peer_t *) item->data;
2364
2365 if (p->next_action_time <= G.cur_time && !p->p_lsa)
2366 resolve_peer_hostname(p);
2367 }
2368
2363 /* Nothing between here and poll() blocks for any significant time */ 2369 /* Nothing between here and poll() blocks for any significant time */
2364 2370
2365 nextaction = G.cur_time + 3600; 2371 nextaction = G.cur_time + 3600;