From: Harlan Stenn Date: Wed, 19 Jul 2006 07:10:22 +0000 (-0400) Subject: [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP X-Git-Tag: NTP_4_2_2P3_RC0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d63f3af4e80ef89cb23fc9f68646e69f80011d43;p=thirdparty%2Fntp.git [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP bk: 44bddadecCz3IVsHAcajqC2XsXJP9g --- diff --git a/configure.ac b/configure.ac index 2581f5c3d..f551353a7 100644 --- a/configure.ac +++ b/configure.ac @@ -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, diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 694ef5d95..898500529 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -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) {