summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2008-08-26 00:09:26 +0000
committerjkim <jkim@FreeBSD.org>2008-08-26 00:09:26 +0000
commit26636164302e6c1b9df4a2884118e8305176d77f (patch)
tree831a0ee330870985f0d3275a6e90d5f72a9981c6
parenta70ab99712ff5aceda3594e58eecfb8a48924908 (diff)
downloadFreeBSD-src-26636164302e6c1b9df4a2884118e8305176d77f.zip
FreeBSD-src-26636164302e6c1b9df4a2884118e8305176d77f.tar.gz
Make sys/net/bpf_filter.c build cleanly on user land.
-rw-r--r--sys/net/bpf.h3
-rw-r--r--sys/net/bpf_filter.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
index 3d3d079..893abb4 100644
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -849,7 +849,6 @@ void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **);
void bpfdetach(struct ifnet *);
void bpfilterattach(int);
-u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int);
static __inline int
bpf_peers_present(struct bpf_if *bpf)
@@ -878,6 +877,8 @@ bpf_peers_present(struct bpf_if *bpf)
} while (0)
#endif
+u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int);
+
/*
* Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
*/
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c
index cac7689..38c3001 100644
--- a/sys/net/bpf_filter.c
+++ b/sys/net/bpf_filter.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
-#ifdef sun
+#if !defined(_KERNEL) || defined(sun)
#include <netinet/in.h>
#endif
@@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$");
#ifdef _KERNEL
#include <sys/mbuf.h>
+#else
+#include <stdlib.h>
#endif
#include <net/bpf.h>
#ifdef _KERNEL
OpenPOWER on IntegriCloud