From b5a82d63b1c0b86660718f593b659c1f0cdeebef Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 3 Feb 2013 10:43:59 +0100 Subject: [PATCH] pf plugin: Fix checking for . The header is not self-contained, so we need to include appropriate headers in the configure check as well. --- configure.in | 15 ++++++++++++++- src/pf.c | 16 ++++++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index d50e8021..fc0a1d1c 100644 --- a/configure.in +++ b/configure.in @@ -536,7 +536,20 @@ AC_CHECK_HEADERS(netinet/if_ether.h, [], [], AC_CHECK_HEADERS(netinet/ip_compat.h) have_net_pfvar_h="no" -AC_CHECK_HEADERS(net/pfvar.h, [have_net_pfvar_h="yes"]) +AC_CHECK_HEADERS(net/pfvar.h, + [have_net_pfvar_h="yes"], + [have_net_pfvar_h="no"], +[ +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif +]) # For the multimeter plugin have_termios_h="no" diff --git a/src/pf.c b/src/pf.c index 0332c3c1..44f0c7bc 100644 --- a/src/pf.c +++ b/src/pf.c @@ -19,13 +19,17 @@ #include "plugin.h" #include "common.h" -#include -#include -#include +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif + #include -#include -#include -#include #ifndef FCNT_NAMES # if FCNT_MAX != 3 -- 2.30.2