diff --git a/src/ntpd.c b/src/ntpd.c
index fc76a2459130619f47219b873b9e551df620201d..e37b3a1cefad037e286dd4bde0cd640940740898 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
#if HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
#endif
#if HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
#endif
-#if HAVE_SYS_POLL_H
-# include <sys/poll.h>
+#if HAVE_POLL_H
+# include <poll.h>
#endif
static char *config_keys[] =
#endif
static char *config_keys[] =
(items_num + pkt_item_num) * res_item_size);
items = realloc ((void *) *res_data,
(items_num + pkt_item_num) * res_item_size);
(items_num + pkt_item_num) * res_item_size);
items = realloc ((void *) *res_data,
(items_num + pkt_item_num) * res_item_size);
+ items_num += pkt_item_num;
if (items == NULL)
{
items = *res_data;
if (items == NULL)
{
items = *res_data;
struct info_peer_summary *ptr;
double offset;
struct info_peer_summary *ptr;
double offset;
- char peername[512];
+ char peername[NI_MAXHOST];
int refclock_id;
ptr = ps + i;
int refclock_id;
ptr = ps + i;
if (ptr->v6_flag)
{
if (ptr->v6_flag)
{
- status = getnameinfo ((const struct sockaddr *) &ptr->srcadr6,
- sizeof (ptr->srcadr6),
+ struct sockaddr_in6 sa;
+
+ memset (&sa, 0, sizeof (sa));
+ sa.sin6_family = AF_INET6;
+ sa.sin6_port = htons (123);
+ memcpy (&sa.sin6_addr, &ptr->srcadr6, sizeof (struct in6_addr));
+
+ status = getnameinfo ((const struct sockaddr *) &sa,
+ sizeof (sa),
peername, sizeof (peername),
NULL, 0, 0 /* no flags */);
if (status != 0)
peername, sizeof (peername),
NULL, 0, 0 /* no flags */);
if (status != 0)