]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP
authorHarlan Stenn <stenn@ntp.org>
Wed, 19 Jul 2006 07:10:22 +0000 (03:10 -0400)
committerHarlan Stenn <stenn@ntp.org>
Wed, 19 Jul 2006 07:10:22 +0000 (03:10 -0400)
bk: 44bddadecCz3IVsHAcajqC2XsXJP9g

configure.ac
ntpd/ntp_io.c

index 2581f5c3d00100b1ebf138e058bdb45d40f34a7a..f551353a743c99e912838bd89a2fb8a3776e7880 100644 (file)
@@ -1750,7 +1750,21 @@ AC_CACHE_CHECK(for kernel multicast support, ac_cv_var_mcast,
   ], ac_cv_var_mcast=yes) ;;
   esac])
 case "$ac_cv_var_mcast" in
- yes) AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?]) ;;
+ yes)
+    AC_DEFINE(MCAST, 1, [Does the kernel support multicasting IP?])
+    AC_CACHE_CHECK([[arg type needed for IP*_MULTICAST_LOOP for setsockopt()]],
+       ac_cv_var_typeof_ip_multicast_loop,
+       [case "$host" in
+        *-*-netbsd|*-*-linux*|*-*-winnt*)
+           ac_cv_var_typeof_ip_multicast_loop=u_int
+           ;;
+        *) ac_cv_var_typeof_ip_multicast_loop=u_char
+           ;;
+       esac])
+    AC_DEFINE_UNQUOTED(TYPEOF_IP_MULTICAST_LOOP,
+                  $ac_cv_var_typeof_ip_multicast_loop,
+                  [What type to use for setsockopt])
+    ;;
 esac
 
 AC_CACHE_CHECK([[availability of ntp_{adj,get}time()]], ac_cv_var_ntp_syscalls,
index 694ef5d9558317fc737c07a66cc3010ea672cfcc..8985005293963b73e638d097e7f2e887cdb88315 100644 (file)
@@ -1016,7 +1016,7 @@ void
 enable_multicast_if(struct interface *iface, struct sockaddr_storage *maddr)
 {
 #ifdef MCAST
-       u_char off = 0;
+       /*u_char*/ TYPEOF_IP_MULTICAST_LOOP off = 0;
 
        switch (maddr->ss_family)
        {