summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-04-27 19:34:01 +0000
committerbz <bz@FreeBSD.org>2011-04-27 19:34:01 +0000
commit26a10f219568393dd25f0b6701ea777f9af29281 (patch)
tree6d4b92ef99cb224e0e021cbe5204d0ef3a524b7d
parentd6e97eaa7bfc6dfbdac2d2e9212d2d587c5d8169 (diff)
downloadFreeBSD-src-26a10f219568393dd25f0b6701ea777f9af29281.zip
FreeBSD-src-26a10f219568393dd25f0b6701ea777f9af29281.tar.gz
Make pf compile without INET support by adding #ifdef INETs and
correcting few #includes. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 4 days
-rw-r--r--sys/contrib/pf/net/if_pflog.c8
-rw-r--r--sys/contrib/pf/net/pf.c2
-rw-r--r--sys/contrib/pf/net/pf_ioctl.c10
3 files changed, 16 insertions, 4 deletions
diff --git a/sys/contrib/pf/net/if_pflog.c b/sys/contrib/pf/net/if_pflog.c
index 6dbb503..d16a09b 100644
--- a/sys/contrib/pf/net/if_pflog.c
+++ b/sys/contrib/pf/net/if_pflog.c
@@ -82,17 +82,17 @@ __FBSDID("$FreeBSD$");
#include <net/route.h>
#include <net/bpf.h>
-#ifdef INET
+#if defined(INET) || defined(INET6)
#include <netinet/in.h>
+#endif
+#ifdef INET
#include <netinet/in_var.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#endif
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
+#include <netinet6/in6_var.h>
#include <netinet6/nd6.h>
#endif /* INET6 */
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index 242834d..d65ab8d 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -2039,8 +2039,10 @@ pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af,
struct pf_mtag *pf_mtag;
struct mbuf *m0;
#ifdef __FreeBSD__
+#ifdef INET
struct ip *ip;
#endif
+#endif
#ifdef __FreeBSD__
m0 = m_copypacket(m, M_DONTWAIT);
diff --git a/sys/contrib/pf/net/pf_ioctl.c b/sys/contrib/pf/net/pf_ioctl.c
index 514b7c3..2a66fd8 100644
--- a/sys/contrib/pf/net/pf_ioctl.c
+++ b/sys/contrib/pf/net/pf_ioctl.c
@@ -216,10 +216,12 @@ static void pf_clear_srcnodes(void);
/*
* Wrapper functions for pfil(9) hooks
*/
+#ifdef INET
static int pf_check_in(void *arg, struct mbuf **m, struct ifnet *ifp,
int dir, struct inpcb *inp);
static int pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp,
int dir, struct inpcb *inp);
+#endif
#ifdef INET6
static int pf_check6_in(void *arg, struct mbuf **m, struct ifnet *ifp,
int dir, struct inpcb *inp);
@@ -3622,6 +3624,7 @@ shutdown_pf(void)
return (error);
}
+#ifdef INET
static int
pf_check_in(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
struct inpcb *inp)
@@ -3696,6 +3699,7 @@ pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
}
return chk;
}
+#endif
#ifdef INET6
static int
@@ -3761,15 +3765,19 @@ hook_pf(void)
pfh_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
if (pfh_inet == NULL)
return (ESRCH); /* XXX */
+#ifdef INET
pfil_add_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet);
pfil_add_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK, pfh_inet);
+#endif
#ifdef INET6
pfh_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6);
if (pfh_inet6 == NULL) {
+#ifdef INET
pfil_remove_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK,
pfh_inet);
pfil_remove_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK,
pfh_inet);
+#endif
return (ESRCH); /* XXX */
}
pfil_add_hook(pf_check6_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet6);
@@ -3796,10 +3804,12 @@ dehook_pf(void)
pfh_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
if (pfh_inet == NULL)
return (ESRCH); /* XXX */
+#ifdef INET
pfil_remove_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK,
pfh_inet);
pfil_remove_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK,
pfh_inet);
+#endif
#ifdef INET6
pfh_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6);
if (pfh_inet6 == NULL)
OpenPOWER on IntegriCloud