From: Danny Mayer Date: Thu, 6 Feb 2003 03:58:52 +0000 (-0500) Subject: IPv6 fixes to handle both NTP and ISC definitions. X-Git-Tag: NTP_4_1_80_RC1~84^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97f2bd0468c0d68bfe8ccc35332a21e1ceb160c6;p=thirdparty%2Fntp.git IPv6 fixes to handle both NTP and ISC definitions. bk: 3e41dd7cQiAQi1JAsX1ziAgrDd1mcQ --- diff --git a/include/isc/netaddr.h b/include/isc/netaddr.h index 94f0f0c2d2..811e8dd48e 100644 --- a/include/isc/netaddr.h +++ b/include/isc/netaddr.h @@ -23,6 +23,9 @@ #include #include #include +#include "ntp_rfc2553.h" + + ISC_LANG_BEGINDECLS diff --git a/include/ntp_rfc2553.h b/include/ntp_rfc2553.h index b9160f9d53..a06efcf770 100644 --- a/include/ntp_rfc2553.h +++ b/include/ntp_rfc2553.h @@ -96,6 +96,12 @@ typedef struct u_int64_t { u_int32 val[2]; } u_int64_t; #ifdef SYS_WINNT #define in6_addr in_addr6 #else +/* + * Don't include any additional IPv6 definitions + * We are defining our own here. + */ +#define ISC_IPV6_H 1 + struct in6_addr { union { u_int8_t __u6_addr8[16]; diff --git a/libntp/ntp_rfc2553.c b/libntp/ntp_rfc2553.c index 313598070e..2f038e2a5b 100644 --- a/libntp/ntp_rfc2553.c +++ b/libntp/ntp_rfc2553.c @@ -251,7 +251,7 @@ do_nodename( ai->ai_addr->sa_len = sizeof(struct sockaddr); #endif if (hints != NULL && hints->ai_flags & AI_CANONNAME) { - ai->ai_canonname = malloc(strlen(hp->h_name)); + ai->ai_canonname = malloc(strlen(hp->h_name) + 1); if (ai->ai_canonname == NULL) return (EAI_MEMORY); strcpy(ai->ai_canonname, hp->h_name);