From: Danny Mayer Date: Sat, 8 Nov 2003 21:49:43 +0000 (-0500) Subject: Fixes to properly support platforms that do not have IPv6 support. X-Git-Tag: NTP_4_2_3~195^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cafcc03c08fff261998c30f6e87f267871074189;p=thirdparty%2Fntp.git Fixes to properly support platforms that do not have IPv6 support. bk: 3fad64f7dh9i2dd-zhusQ9qgNylKqQ --- diff --git a/include/isc/ipv6.h b/include/isc/ipv6.h index 18893b7003..6146a43e78 100644 --- a/include/isc/ipv6.h +++ b/include/isc/ipv6.h @@ -102,12 +102,13 @@ struct sockaddr_in6 { /* * Unspecified */ +#ifndef IN6_IS_ADDR_UNSPECIFIED #define IN6_IS_ADDR_UNSPECIFIED(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == 0)) - +#endif /* * Loopback */ @@ -138,9 +139,10 @@ struct sockaddr_in6 { /* * Multicast */ +#ifndef IN6_IS_ADDR_MULTICAST #define IN6_IS_ADDR_MULTICAST(a) \ ((a)->s6_addr8[0] == 0xffU) - +#endif /* * Unicast link / site local. */ diff --git a/include/ntp_rfc2553.h b/include/ntp_rfc2553.h index 28ff004b88..bdf5923980 100644 --- a/include/ntp_rfc2553.h +++ b/include/ntp_rfc2553.h @@ -68,9 +68,7 @@ #ifndef _NTP_RFC2553_H_ #define _NTP_RFC2553_H_ -#if defined(_SS_MAXSIZE) || defined(_SS_SIZE) -#define HAVE_IPV6 -#else +#ifndef ISC_PLATFORM_HAVEIPV6 #include #include "ntp_types.h" @@ -250,5 +248,5 @@ int getnameinfo P((const struct sockaddr *, u_int, char *, void freeaddrinfo P((struct addrinfo *)); char *gai_strerror P((int)); -#endif /* _SS_MAXSIZE */ +#endif /* ISC_PLATFORM_HAVEIPV6 */ #endif /* !_NTP_RFC2553_H_ */ diff --git a/libntp/ntp_rfc2553.c b/libntp/ntp_rfc2553.c index 278863085e..9b29f8a3f6 100644 --- a/libntp/ntp_rfc2553.c +++ b/libntp/ntp_rfc2553.c @@ -83,7 +83,7 @@ #include "ntp_stdlib.h" #include "ntp_string.h" -#ifndef HAVE_IPV6 +#ifndef ISC_PLATFORM_HAVEIPV6 #if defined(SYS_WINNT) /* XXX This is the preferred way, but for some reason the SunOS compiler @@ -328,4 +328,4 @@ ipv4_aton( #endif return (1); } -#endif /* !HAVE_IPV6 */ +#endif /* !ISC_PLATFORM_HAVEIPV6 */ diff --git a/ports/winnt/include/isc/ipv6.h b/ports/winnt/include/isc/ipv6.h index 3822731d81..3fe77dc73d 100644 --- a/ports/winnt/include/isc/ipv6.h +++ b/ports/winnt/include/isc/ipv6.h @@ -56,13 +56,14 @@ LIBISC_EXTERNAL_DATA extern const struct in_addr6 in6addr_loopback; * Unspecified */ +#ifndef IN6_IS_ADDR_UNSPECIFIED #define IN6_IS_ADDR_UNSPECIFIED(a) \ *((u_long *)((a)->s6_addr) ) == 0 && \ *((u_long *)((a)->s6_addr) + 1) == 0 && \ *((u_long *)((a)->s6_addr) + 2) == 0 && \ *((u_long *)((a)->s6_addr) + 3) == 0 \ ) - +#endif /* * Loopback */ @@ -95,9 +96,10 @@ LIBISC_EXTERNAL_DATA extern const struct in_addr6 in6addr_loopback; /* * Multicast */ +#ifndef IN6_IS_ADDR_MULTICAST #define IN6_IS_ADDR_MULTICAST(a) \ ((a)->s6_addr8[0] == 0xffU) - +#endif /* * Unicast link / site local. */ diff --git a/ports/winnt/include/isc/platform.h b/ports/winnt/include/isc/platform.h index 747e0504dc..10e2a012b8 100644 --- a/ports/winnt/include/isc/platform.h +++ b/ports/winnt/include/isc/platform.h @@ -30,7 +30,12 @@ *** Network. ***/ +/* + * This should not be defined yet until we can support IPV6 + * on Windows Platforms. + * #define ISC_PLATFORM_HAVEIPV6 +*/ #define ISC_PLATFORM_NEEDPORTT #undef MSG_TRUNC #define ISC_PLATFORM_NEEDNTOP