linux/mroutes.h and pim_mroute.h both have copies of the same structures.
This is causing failures in setsockopt(..., MRT_ADD_MFC,...) because
of data structure incompatibilities between the kernel and what
pim_mroute.h was providing.  Modify the code to check for mroute.h
and include it if necessary.  I did not modify the non linux/mroute.h
path because I do not have other systems to test on easily.

Signed-off-by: Donald Sharp <[email protected]>
---
 configure.ac      |    5 +++++
 pimd/pim_mroute.h |    4 ++++
 2 files changed, 9 insertions(+)

diff --git a/configure.ac b/configure.ac
index f20fb3f..f44b421 100755
--- a/configure.ac
+++ b/configure.ac
@@ -939,6 +939,11 @@ dnl figure out how to specify an interface in multicast 
sockets API
 dnl ---------------------------------------------------------------
 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [], [], QUAGGA_INCLUDES)
 
+AC_CHECK_HEADERS([linux/mroute.h], [], [],
+[
+#if HAVE_NETINET_IN_H
+#include<netinet/in.h>
+#endif])
 AC_MSG_CHECKING([for BSD struct ip_mreq hack])
 AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
diff --git a/pimd/pim_mroute.h b/pimd/pim_mroute.h
index 350b1e3..125d190 100644
--- a/pimd/pim_mroute.h
+++ b/pimd/pim_mroute.h
@@ -40,6 +40,9 @@
 
 #define PIM_MROUTE_MIN_TTL (1)
 
+#if defined(HAVE_LINUX_MROUTE_H)
+#include <linux/mroute.h>
+#else
 /*
   Below: from <linux/mroute.h>
 */
@@ -154,6 +157,7 @@ struct igmpmsg
   struct in_addr im_src,im_dst;
 };
 #endif
+#endif
 
 /*
   Above: from <linux/mroute.h>
-- 
1.7.10.4


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to