]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Use `struct ip_mreqn' instead of `struct ip_mreq' for multicast
authorMartin Mares <mj@ucw.cz>
Mon, 12 Apr 1999 15:27:56 +0000 (15:27 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 12 Apr 1999 15:27:56 +0000 (15:27 +0000)
operations on 2.1/2.2 kernels. This allows passing of real interface
indexes instead of referencing interfaces by their IP addresses which
fails badly in presence of unnumbered interfaces.

Unfortunately, this structure is not visible with glibc 2.0 as it provides
its own networking headers :-(  Both libc5 and glibc 2.1 should be OK.

aclocal.m4
configure.in
sysdep/autoconf.h.in
sysdep/unix/io.c

index 651b0db4479fd1f440d82d11cec2f0cf40e7b9bf..98a5ca8edff709051cb6a4335febe122f17506fb 100644 (file)
@@ -116,3 +116,15 @@ case "$bird_cv_type_time_t" in
        *)              AC_DEFINE(TIME_T_IS_SIGNED) ;;
        esac
 ])
+
+AC_DEFUN(BIRD_CHECK_STRUCT_IP_MREQN,
+[AC_CACHE_CHECK([struct ip_mreqn], bird_cv_struct_ip_mreqn,[
+AC_TRY_COMPILE([#include <netinet/in.h>
+],[struct ip_mreqn x;
+],[bird_cv_struct_ip_mreqn=yes
+],[bird_cv_struct_ip_mreqn=no
+])])
+if test "$bird_cv_struct_ip_mreqn" = yes ; then
+       AC_DEFINE(HAVE_STRUCT_IP_MREQN)
+fi
+])
index 2cf123a49ee6c13b35d118277ba319d282f7b723..a8ef7347ec42af6fbdde46c930349ce28916a278 100644 (file)
@@ -109,6 +109,7 @@ BIRD_CHECK_INTEGERS
 BIRD_CHECK_ENDIAN
 BIRD_CHECK_STRUCT_ALIGN
 BIRD_CHECK_TIME_T
+BIRD_CHECK_STRUCT_MREQN
 
 if test "$enable_debug" = yes ; then
        AC_DEFINE(PATH_CONFIG_DIR, ".")
index ae4d6b65a9a4015fc4f397f59247b7f9a46a9c8f..6c76f1a9c4fba26926d7a0c9ffdefd95989a2dd1 100644 (file)
@@ -29,6 +29,9 @@
 #undef TIME_T_IS_64BIT
 #undef TIME_T_IS_SIGNED
 
+/* We have struct ip_mreqn in <netinet/in.h> */
+#undef HAVE_STRUCT_IP_MREQN
+
 /* Protocols compiled in */
 #undef CONFIG_STATIC
 #undef CONFIG_RIP
index 69f8a5c7b727af54b64e77557b1a66d9ae369513..d98972c700cd424354e59e084603ce87ab916405 100644 (file)
@@ -407,8 +407,7 @@ sk_open(sock *s)
     case SK_UDP_MC:
     case SK_IP_MC:
       {
-#ifdef HAVE_IP_MREQN
-       /* FIXME: Define HAVE_IP_MREQN somewhere :) */
+#ifdef HAVE_STRUCT_IP_MREQN
        struct ip_mreqn mreq;
 #define mreq_add mreq
        ASSERT(s->iface);