1 --- a/networking/ntpd.c
2 +++ b/networking/ntpd.c
3 @@ -216,6 +216,7 @@ typedef struct {
5 len_and_sockaddr *p_lsa;
8 /* when to send new query (if p_fd == -1)
9 * or when receive times out (if p_fd >= 0): */
11 @@ -646,8 +647,9 @@ add_peers(char *s)
14 p = xzalloc(sizeof(*p));
15 - p->p_lsa = xhost2sockaddr(s, 123);
16 - p->p_dotted = xmalloc_sockaddr2dotted_noport(&p->p_lsa->u.sa);
21 p->p_xmt_msg.m_status = MODE_CLIENT | (NTP_VERSION << 3);
22 p->next_action_time = G.cur_time; /* = set_next(p, 0); */
23 @@ -696,6 +698,25 @@ send_query_to_peer(peer_t *p)
25 * Uncomment this and use strace to see it in action:
28 + /* See if the peer hostname already resolved yet, if not, retry to resolv and return on failure */
31 + p->p_lsa = host2sockaddr(p->p_hostname, 123);
35 + p->p_dotted = xmalloc_sockaddr2dotted_noport(&p->p_lsa->u.sa);
36 + VERB1 bb_error_msg("resolved peer %s to %s", p->p_hostname, p->p_dotted);
40 + set_next(p, RETRY_INTERVAL);
41 + VERB1 bb_error_msg("could not resolve peer %s, skipping", p->p_hostname);
46 #define PROBE_LOCAL_ADDR /* { len_and_sockaddr lsa; lsa.len = LSA_SIZEOF_SA; getsockname(p->query.fd, &lsa.u.sa, &lsa.len); } */