diff --git a/configure.ac b/configure.ac index d9ad51b6ca6d..2b3b82c745ea 100644 --- a/configure.ac +++ b/configure.ac @@ -1240,7 +1240,6 @@ m4_define([FRR_INCLUDES], #include #include #include -/* sys/conf.h depends on param.h on FBSD at least */ #include /* Required for MAXSIG */ #include @@ -1251,23 +1250,8 @@ m4_define([FRR_INCLUDES], #include ])dnl -dnl Same applies for HAVE_NET_IF_VAR_H, which HAVE_NETINET6_ND6_H and -dnl HAVE_NETINET_IN_VAR_H depend upon. But if_var.h depends on if.h, hence -dnl an additional round for it. - -AC_CHECK_HEADERS([net/if_var.h], [], [], [FRR_INCLUDES]) - -m4_define([FRR_INCLUDES], -FRR_INCLUDES -[#ifdef HAVE_NET_IF_VAR_H -# include -#endif -])dnl - AC_CHECK_HEADERS([netinet/in_var.h \ - net/if_dl.h \ - netinet/ip_icmp.h \ - sys/sysctl.h sys/sockio.h sys/conf.h], + netinet/ip_icmp.h], [], [], [FRR_INCLUDES]) AC_CHECK_HEADERS([ucontext.h], [], [], @@ -1297,7 +1281,7 @@ FRR_INCLUDES #ifdef HAVE_NETINET_IN_VAR_H # include #endif -#ifdef HAVE_NET_IF_DL_H +#ifndef __linux__ # include #endif #include @@ -1797,15 +1781,12 @@ dnl ------------------ dnl IPv6 header checks dnl ------------------ AC_CHECK_HEADERS([ \ - netinet6/in6_var.h netinet6/nd6.h], [], [], + netinet6/nd6.h], [], [], FRR_INCLUDES) m4_define([FRR_INCLUDES],dnl FRR_INCLUDES [#include -#ifdef HAVE_NETINET6_IN6_VAR_H -# include -#endif #ifdef HAVE_NETINET6_ND6_H # include #endif @@ -2310,7 +2291,7 @@ AC_CHECK_TYPES([ struct sockaddr_dl, struct vifctl, struct mfcctl, struct sioc_sg_req, vifi_t, struct sioc_vif_req, struct igmpmsg, - struct ifaliasreq, struct in6_aliasreq, + struct ifaliasreq, struct nd_opt_adv_interval, struct nd_opt_homeagent_info, struct nd_opt_adv_interval, struct nd_opt_rdnss, struct nd_opt_dnssl], diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c index 76e0da9b8efa..4daff32018bd 100644 --- a/eigrpd/eigrp_packet.c +++ b/eigrpd/eigrp_packet.c @@ -12,6 +12,10 @@ #include +#ifndef __linux__ +#include +#endif + #include "frrevent.h" #include "memory.h" #include "linklist.h" diff --git a/ldpd/packet.c b/ldpd/packet.c index 42d526aa0b8b..1cf0859379f5 100644 --- a/ldpd/packet.c +++ b/ldpd/packet.c @@ -9,6 +9,10 @@ #include +#ifndef __linux__ +#include +#endif + #include "ldpd.h" #include "ldpe.h" #include "log.h" diff --git a/lib/prefix.h b/lib/prefix.h index 2d679d06224f..d42a383de02c 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -7,7 +7,7 @@ #ifndef _ZEBRA_PREFIX_H #define _ZEBRA_PREFIX_H -#ifdef GNU_LINUX +#ifdef __linux__ #include #else #include diff --git a/lib/sockopt.c b/lib/sockopt.c index 003ddb72dc2d..e3fee61cb704 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -5,6 +5,10 @@ #include +#ifndef __linux__ +#include +#endif + #include "log.h" #include "sockopt.h" #include "sockunion.h" diff --git a/lib/sockunion.c b/lib/sockunion.c index 13a98db07bd6..fd4fc8bf1ba5 100644 --- a/lib/sockunion.c +++ b/lib/sockunion.c @@ -5,6 +5,10 @@ #include +#ifndef __linux__ +#include +#endif + #include "prefix.h" #include "vty.h" #include "sockunion.h" diff --git a/lib/zebra.h b/lib/zebra.h index bae81537bb7a..46d3c2f660c5 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -19,16 +19,6 @@ #include #include #include -#ifdef HAVE_SYS_SYSCTL_H -#ifdef GNU_LINUX -#include -#else -#include -#endif -#endif /* HAVE_SYS_SYSCTL_H */ -#ifdef HAVE_SYS_CONF_H -#include -#endif /* HAVE_SYS_CONF_H */ #include #include #include @@ -44,10 +34,6 @@ #include -#ifdef HAVE_SYS_SOCKIO_H -#include -#endif /* HAVE_SYS_SOCKIO_H */ - #include "openbsd-tree.h" #include @@ -56,14 +42,6 @@ #include -#ifdef HAVE_NET_IF_DL_H -#include -#endif /* HAVE_NET_IF_DL_H */ - -#ifdef HAVE_NET_IF_VAR_H -#include -#endif /* HAVE_NET_IF_VAR_H */ - #ifndef HAVE_NETLINK #define RT_TABLE_MAIN 0 #define RT_TABLE_LOCAL RT_TABLE_MAIN @@ -76,10 +54,6 @@ #include #endif /* HAVE_NETINET_IN_VAR_H */ -#ifdef HAVE_NETINET6_IN6_VAR_H -#include -#endif /* HAVE_NETINET6_IN6_VAR_H */ - #ifdef HAVE_NETINET6_IN_H #include #endif /* HAVE_NETINET6_IN_H */ diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index e79bc3498361..2e245b1442c4 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -5,6 +5,10 @@ #include +#ifndef __linux__ +#include +#endif + #include "memory.h" #include "if.h" #include "log.h" diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 355808e09170..0f0590c270e1 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -6,6 +6,10 @@ #include +#ifndef __linux__ +#include +#endif + #include "monotime.h" #include "frrevent.h" #include "memory.h" diff --git a/pceplib/pcep.h b/pceplib/pcep.h index cb7019dac6e2..7d3378c70457 100644 --- a/pceplib/pcep.h +++ b/pceplib/pcep.h @@ -15,7 +15,7 @@ #include "config.h" #endif -#if defined(linux) || defined(GNU_LINUX) +#ifdef __linux__ #define ipv6_u __in6_u #else diff --git a/zebra/if_sysctl.c b/zebra/if_sysctl.c index 28cbb0415a5c..12f8b91ef446 100644 --- a/zebra/if_sysctl.c +++ b/zebra/if_sysctl.c @@ -10,6 +10,8 @@ #if !defined(GNU_LINUX) && !defined(OPEN_BSD) +#include + #include "if.h" #include "sockunion.h" #include "prefix.h" diff --git a/zebra/interface.h b/zebra/interface.h index 5b45656bd5ac..0947a2294226 100644 --- a/zebra/interface.h +++ b/zebra/interface.h @@ -7,6 +7,10 @@ #ifndef _ZEBRA_INTERFACE_H #define _ZEBRA_INTERFACE_H +#ifndef __linux__ +#include +#endif + #include "redistribute.h" #include "vrf.h" #include "hook.h" diff --git a/zebra/ioctl.c b/zebra/ioctl.c index f89412f6d60a..2449f62e30fb 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -7,6 +7,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include "linklist.h" #include "if.h" @@ -533,12 +536,6 @@ int if_unset_flags(struct interface *ifp, uint64_t flags) } #ifndef LINUX_IPV6 /* Netlink has its own code */ - -#ifdef HAVE_STRUCT_IN6_ALIASREQ -#ifndef ND6_INFINITE_LIFETIME -#define ND6_INFINITE_LIFETIME 0xffffffffL -#endif /* ND6_INFINITE_LIFETIME */ - /* * Helper for interface-addr install, non-netlink */ @@ -614,29 +611,9 @@ static int if_unset_prefix6_ctx(const struct zebra_dplane_ctx *ctx) #endif memcpy(&addreq.ifra_prefixmask, &mask, sizeof(struct sockaddr_in6)); -#ifdef HAVE_STRUCT_IF6_ALIASREQ_IFRA_LIFETIME - addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; - addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; -#endif - ret = if_ioctl_ipv6(SIOCDIFADDR_IN6, (caddr_t)&addreq); if (ret < 0) return ret; return 0; } -#else -/* The old, pre-dataplane code here just returned, so we're retaining that - * choice. - */ -static int if_set_prefix6_ctx(const struct zebra_dplane_ctx *ctx) -{ - return 0; -} - -static int if_unset_prefix6_ctx(const struct zebra_dplane_ctx *ctx) -{ - return 0; -} -#endif /* HAVE_STRUCT_IN6_ALIASREQ */ - #endif /* LINUX_IPV6 */ diff --git a/zebra/ipforward_sysctl.c b/zebra/ipforward_sysctl.c index bc9d12b5225a..fc2571d2bd88 100644 --- a/zebra/ipforward_sysctl.c +++ b/zebra/ipforward_sysctl.c @@ -7,6 +7,8 @@ #if !defined(GNU_LINUX) +#include + #include "privs.h" #include "zebra/ipforward.h" #include "zebra/zebra_errors.h" diff --git a/zebra/rtread_sysctl.c b/zebra/rtread_sysctl.c index 8e2d13fafff0..2f073f6c303d 100644 --- a/zebra/rtread_sysctl.c +++ b/zebra/rtread_sysctl.c @@ -10,6 +10,8 @@ #if !defined(GNU_LINUX) +#include + #include "memory.h" #include "log.h" #include "vrf.h" diff --git a/zebra/table_manager.h b/zebra/table_manager.h index f16efdd6266b..11225b756ddc 100644 --- a/zebra/table_manager.h +++ b/zebra/table_manager.h @@ -21,7 +21,7 @@ extern "C" { /* routing table identifiers * */ -#if !defined(GNU_LINUX) +#ifndef __linux__ /* BSD systems */ #define RT_TABLE_ID_MAIN 0 @@ -33,7 +33,7 @@ extern "C" { #define RT_TABLE_ID_DEFAULT 253 #define RT_TABLE_ID_COMPAT 252 #define RT_TABLE_ID_UNSPEC 0 -#endif /* !def(GNU_LINUX) */ +#endif /* !__linux__ */ /* * Table chunk struct