From: Donald Sharp Date: Fri, 8 Mar 2024 18:04:34 +0000 (+0000) Subject: pimd: Cleanup inclusion of headers X-Git-Tag: docker/10.0~18^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c1551644d6bd01a2c2aa7907069f68e79e951b39;p=mirror%2Ffrr.git pimd: Cleanup inclusion of headers FRR needs to properly include the FreeBSD headers for compilation on FreeBSD. I have setup v6 as well but I have not even tested it. Since I know that the form is the same I think this is ok at the moment. This is a step forward. Because of this change *clearly* no-one is even using pim on FreeBSD. . In any event this is a step in the direction of getting that working again. Signed-off-by: Donald Sharp (cherry picked from commit a5389154a1363ea778e0cafddc34f1964631278c) --- diff --git a/configure.ac b/configure.ac index 1756aa2e02..5c1f17057f 100644 --- a/configure.ac +++ b/configure.ac @@ -1656,6 +1656,21 @@ FRR_INCLUDES #endif ])dnl +AC_CHECK_HEADERS([netinet6/ip6_mroute.h], [], [],[ + #include + #include + #include + #include + #include +]) + +m4_define([FRR_INCLUDES], +FRR_INCLUDES +[#ifdef HAVE_NETINET_IP6_MROUTE_H +# include +#endif +])dnl + AC_MSG_CHECKING([for RFC3678 protocol-independed API]) AC_COMPILE_IFELSE( [ AC_LANG_PROGRAM([[ diff --git a/pimd/pim_mroute.h b/pimd/pim_mroute.h index 8706f42206..fd4913ca42 100644 --- a/pimd/pim_mroute.h +++ b/pimd/pim_mroute.h @@ -25,8 +25,19 @@ #include #if defined(HAVE_LINUX_MROUTE_H) #include -#else -#include "linux/mroute.h" +#endif + +#if defined(HAVE_NETINET_IP_MROUTE_H) +#include +/* + * MRT_TABLE of 155 is needed because it is not defined + * on FreeBSD. MRT_TABLE is for vrf's. There is no + * equivalent on BSD at this point in time. Let's + * just get it compiling + */ +#ifndef MRT_TABLE +#define MRT_TABLE 155 +#endif #endif typedef struct vifctl pim_vifctl; @@ -70,8 +81,17 @@ typedef struct sioc_sg_req pim_sioc_sg_req; #if defined(HAVE_LINUX_MROUTE6_H) #include -#else -#include "linux/mroute6.h" +#endif +#if defined(HAVE_NETINET_IP6_MROUTE_H) +#include +#include + +/* + * See the v4 discussion above + */ +#ifndef MRT_TABLE +#define MRT_TABLE 155 +#endif #endif #ifndef MRT_INIT