]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared.
authorDave Hart <hart@ntp.org>
Wed, 28 Oct 2009 07:35:54 +0000 (07:35 +0000)
committerDave Hart <hart@ntp.org>
Wed, 28 Oct 2009 07:35:54 +0000 (07:35 +0000)
bk: 4ae7f45a1XSfdlZdSHa4Ijn0IflJgA

ChangeLog
include/ntp_rfc2553.h
ntpd/ntp_io.c
sntp/networking.c
sntp/networking.h

index de2f3bd6536c0216982fcaf78c96f49191a31261..7633bdfa4010bd657c584f986550387522cfe133 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared.
 (4.2.5p238-RC) 2009/10/27 Released by Harlan Stenn <stenn@ntp.org>
 * Changes from Dave Mills.
 * driver4.html updates from Dave Mills.
index ef3374c9e1df674a276ecd23bb50bbcfefbb5bb9..4ed1b657cbe4f0f46338f100098e05dabf6c1ba4 100644 (file)
@@ -134,7 +134,7 @@ struct sockaddr_storage {
 /*
  * Flag values for getaddrinfo()
  */
-#ifndef AI_NUMERICHOST
+#ifndef AI_PASSIVE
 #define        AI_PASSIVE      0x00000001 /* get address to use bind() */
 #define        AI_CANONNAME    0x00000002 /* fill ai_canonname */
 #define        AI_NUMERICHOST  0x00000004 /* prevent name resolution */
@@ -143,6 +143,10 @@ struct sockaddr_storage {
     (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG)
 
 #define        AI_ADDRCONFIG   0x00000400 /* only if any address is assigned */
+#endif /* !AI_PASSIVE */
+
+#ifndef AI_NUMERICHOST         /* such as AIX 4.3 */
+#define AI_NUMERICHOST 0
 #endif
 
 #ifndef ISC_PLATFORM_HAVEIPV6
@@ -208,6 +212,17 @@ char       *gai_strerror (int);
 #define NI_WITHSCOPEID 0x00000020
 #endif
 
-#endif /* ISC_PLATFORM_HAVEIPV6 */
+#endif /* !ISC_PLATFORM_HAVEIPV6 */
+
+/* 
+ * Set up some macros to look for IPv6 and IPv6 multicast
+ */
+
+#if defined(ISC_PLATFORM_HAVEIPV6) && defined(WANT_IPV6)
+# define INCLUDE_IPV6_SUPPORT
+# if defined(IPV6_JOIN_GROUP) && defined(IPV6_LEAVE_GROUP)
+#  define INCLUDE_IPV6_MULTICAST_SUPPORT
+# endif        /* IPV6 Multicast Support */
+#endif  /* IPv6 Support */
 
 #endif /* !NTP_RFC2553_H */
index 8f0c220a43a9a15856882e600b7a4315523e440e..0d380c72d95baeb37d08004c8424ad4e6696b5ee 100644 (file)
 #define SETSOCKOPT_ARG_CAST
 #endif
 
-/* 
- * Set up some macros to look for IPv6 and IPv6 multicast
- */
-
-#if defined(ISC_PLATFORM_HAVEIPV6) && defined(WANT_IPV6)
-
-#define INCLUDE_IPV6_SUPPORT
-
-#if defined(INCLUDE_IPV6_SUPPORT) && defined(IPV6_JOIN_GROUP) && defined(IPV6_LEAVE_GROUP)
-#define INCLUDE_IPV6_MULTICAST_SUPPORT
-
-#endif /* IPV6 Multicast Support */
-#endif  /* IPv6 Support */
-
 extern int listen_to_virtual_ips;
 
 /*
index 93b78f902a2acc6b4010b33345f1be5d7331ad01..a78eec16d61f3bc05019f3f6fe17fba451477ffb 100644 (file)
@@ -214,7 +214,7 @@ recv_bcst_data (
                }
 
 
-               if(setsockopt(rsock, IPPROTO_IP, IP_MULTICAST_LOOP, &btrue, sizeof(btrue)) < 0) {
+               if (setsockopt(rsock, IPPROTO_IP, IP_MULTICAST_LOOP, &btrue, sizeof(btrue)) < 0) {
                        /* some error message regarding setting up multicast loop */
                        return BROADCAST_FAILED;
                }
@@ -245,6 +245,9 @@ recv_bcst_data (
        }
 #ifdef ISC_PLATFORM_HAVEIPV6
        else if (IS_IPV6(sas)) {
+#ifndef INCLUDE_IPV6_MULTICAST_SUPPORT
+               return BROADCAST_FAILED;
+#else
                struct ipv6_mreq mdevadr;
 
                if (bind(rsock, &sas->sa, SOCKLEN(sas)) < 0) {
@@ -252,7 +255,7 @@ recv_bcst_data (
                                printf("sntp recv_bcst_data: Couldn't bind() address.\n");
                }
 
-               if(setsockopt(rsock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &btrue, sizeof (btrue)) < 0) {
+               if (setsockopt(rsock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &btrue, sizeof (btrue)) < 0) {
                        /* some error message regarding setting up multicast loop */
                        return BROADCAST_FAILED;
                }
@@ -283,6 +286,7 @@ recv_bcst_data (
                                return BROADCAST_FAILED;
                        }
                }
+#endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
        }
 #endif /* ISC_PLATFORM_HAVEIPV6 */
        
@@ -306,7 +310,8 @@ recv_bcst_data (
 
                case 0:
                        if(ENABLED_OPT(NORMALVERBOSE))
-                               printf("sntp recv_bcst_data: select() reached timeout (%li sec), aborting.\n", timeout_tv.tv_sec);
+                               printf("sntp recv_bcst_data: select() reached timeout (%u sec), aborting.\n", 
+                                      (unsigned)timeout_tv.tv_sec);
 
                        return BROADCAST_FAILED;
                        break;
index 0d5fecf120dd4ce35f44e8859471afb0557db8bc..c8a0870cfa4ae6256d69d8ed780055f7628968ea 100644 (file)
@@ -29,6 +29,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 
+#include <ntp_rfc2553.h>
 #include <ntp_stdlib.h>
 #include <ntp_machine.h>
 #include <ntp_unixtime.h>