diff options
author | bz <bz@FreeBSD.org> | 2011-04-27 19:30:44 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2011-04-27 19:30:44 +0000 |
commit | 19104877222319644c02e765fc7a731750eaa78f (patch) | |
tree | 41ab0d5e24ff61a4333e89667bf72cddb5e47b41 /sys/net | |
parent | d28e675043d30fd2673b02842a810b8aec8b1696 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/net/if_enc.c | 18 | ||||
-rw-r--r-- | sys/net/if_lagg.c | 4 |
2 files changed, 15 insertions, 7 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, diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index ee586ad..cbe9b99 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -52,8 +52,10 @@ __FBSDID("$FreeBSD$"); #include <net/if_var.h> #include <net/bpf.h> -#ifdef INET +#if defined(INET) || defined(INET6) #include <netinet/in.h> +#endif +#ifdef INET #include <netinet/in_systm.h> #include <netinet/if_ether.h> #include <netinet/ip.h> |