From: John Hay Date: Tue, 13 Aug 2002 18:03:41 +0000 (+0200) Subject: Fix compilation on Slackware 8.1 with the help of Andrew Hood X-Git-Tag: NTP_4_1_73~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b25973d5a407bbd233e6b9707980615cd3d31fc1;p=thirdparty%2Fntp.git Fix compilation on Slackware 8.1 with the help of Andrew Hood bk: 3d5949fdqmJmISsQbJ3aAwEcD0RzSA --- diff --git a/include/ntp_rfc2553.h b/include/ntp_rfc2553.h index 0f6ef05a90..b728de90f8 100644 --- a/include/ntp_rfc2553.h +++ b/include/ntp_rfc2553.h @@ -68,7 +68,7 @@ #ifndef _NTP_RFC2553_H_ #define _NTP_RFC2553_H_ -#ifdef _SS_MAXSIZE +#if defined(_SS_MAXSIZE) || defined(_SS_SIZE) #define HAVE_IPV6 #else diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index 8699366650..3f642ac03b 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -412,7 +412,10 @@ openhost( char service[5]; memset((char *)&hints, 0, sizeof(struct addrinfo)); - hints.ai_flags = AI_ADDRCONFIG|AI_CANONNAME; + hints.ai_flags = AI_CANONNAME; +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; +#endif hints.ai_family = ai_fam_templ; hints.ai_protocol = IPPROTO_UDP; hints.ai_socktype = SOCK_DGRAM; @@ -1367,7 +1370,10 @@ getnetnum( ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); memset((char *)&hints, 0, sizeof(struct addrinfo)); - hints.ai_flags = AI_ADDRCONFIG|AI_CANONNAME; + hints.ai_flags = AI_CANONNAME; +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; +#endif /* decodenetnum only works with addresses */ if (decodenetnum(hname, num)) { diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index c833405037..7eef4f9be2 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -593,7 +593,10 @@ openhost( char service[5]; memset((char *)&hints, 0, sizeof(struct addrinfo)); - hints.ai_flags = AI_ADDRCONFIG|AI_CANONNAME; + hints.ai_flags = AI_CANONNAME; +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; +#endif hints.ai_family = ai_fam_templ; hints.ai_protocol = IPPROTO_UDP; hints.ai_socktype = SOCK_DGRAM; @@ -1653,7 +1656,10 @@ getnetnum( ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); memset((char *)&hints, 0, sizeof(struct addrinfo)); - hints.ai_flags = AI_ADDRCONFIG|AI_CANONNAME; + hints.ai_flags = AI_CANONNAME; +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; +#endif /* decodenetnum works with addresses only */ if (decodenetnum(hname, num)) {