summaryrefslogtreecommitdiffstats
path: root/sys/net/if_enc.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-04-27 19:30:44 +0000
committerbz <bz@FreeBSD.org>2011-04-27 19:30:44 +0000
commit19104877222319644c02e765fc7a731750eaa78f (patch)
tree41ab0d5e24ff61a4333e89667bf72cddb5e47b41 /sys/net/if_enc.c
parentd28e675043d30fd2673b02842a810b8aec8b1696 (diff)
downloadFreeBSD-src-19104877222319644c02e765fc7a731750eaa78f.zip
FreeBSD-src-19104877222319644c02e765fc7a731750eaa78f.tar.gz
Make various (pseudo) interfaces compile without INET in the kernel
adding appropriate #ifdefs. For module builds the framework needs adjustments for at least carp. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 4 days
Diffstat (limited to 'sys/net/if_enc.c')
-rw-r--r--sys/net/if_enc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c
index 6ba1174..eee3733 100644
--- a/sys/net/if_enc.c
+++ b/sys/net/if_enc.c
@@ -27,6 +27,10 @@
* $FreeBSD$
*/
+#include "opt_inet.h"
+#include "opt_inet6.h"
+#include "opt_enc.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -53,14 +57,12 @@
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/in_var.h>
-#include "opt_inet6.h"
#ifdef INET6
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#endif
-#include "opt_enc.h"
#include <netipsec/ipsec.h>
#include <netipsec/xform.h>
@@ -243,11 +245,14 @@ ipsec_filter(struct mbuf **mp, int dir, int flags)
}
/* Skip pfil(9) if no filters are loaded */
- if (!(PFIL_HOOKED(&V_inet_pfil_hook)
+ if (1
+#ifdef INET
+ && !PFIL_HOOKED(&V_inet_pfil_hook)
+#endif
#ifdef INET6
- || PFIL_HOOKED(&V_inet6_pfil_hook)
+ && !PFIL_HOOKED(&V_inet6_pfil_hook)
#endif
- )) {
+ ) {
return (0);
}
@@ -263,6 +268,7 @@ ipsec_filter(struct mbuf **mp, int dir, int flags)
error = 0;
ip = mtod(*mp, struct ip *);
switch (ip->ip_v) {
+#ifdef INET
case 4:
/*
* before calling the firewall, swap fields the same as
@@ -282,7 +288,7 @@ ipsec_filter(struct mbuf **mp, int dir, int flags)
ip->ip_len = htons(ip->ip_len);
ip->ip_off = htons(ip->ip_off);
break;
-
+#endif
#ifdef INET6
case 6:
error = pfil_run_hooks(&V_inet6_pfil_hook, mp,
OpenPOWER on IntegriCloud