diff options
author | peter <peter@FreeBSD.org> | 2001-01-29 13:26:14 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-01-29 13:26:14 +0000 |
commit | 45d023e517fe74bc20d44c77e4612f3b5cf616ad (patch) | |
tree | d7ccee522152338ce8cc4dbcea7e04d873fa15a6 /sys/net/bpf.c | |
parent | 695e2716fdfbb7a4b3c7a07c6660c4f562fc1864 (diff) | |
download | FreeBSD-src-45d023e517fe74bc20d44c77e4612f3b5cf616ad.zip FreeBSD-src-45d023e517fe74bc20d44c77e4612f3b5cf616ad.tar.gz |
Supply a stub bpf_validate() (always returning false - the script is not
valid) if BPF is missing.
The netgraph_bpf node forced bpf to be present, reflect that in the
options.
Stop doing a 'count bpf' - we provide stubs.
Since a handful of drivers still refer to "bpf.h", provide a more accurate
indication that the API is present always. (eg: netinet6)
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r-- | sys/net/bpf.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 6487a82..23956f7 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -40,7 +40,8 @@ * $FreeBSD$ */ -#include "bpf.h" +#include "opt_bpf.h" +#include "opt_netgraph.h" #ifndef __GNUC__ #define inline @@ -80,7 +81,7 @@ static MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); -#if NBPF > 0 +#if defined(DEV_BPF) || defined(NETGRAPH_BPF) /* * Older BSDs don't have kernel malloc. @@ -1396,7 +1397,7 @@ bpf_drvinit(unused) SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bpf_drvinit,NULL) -#else /* !BPF */ +#else /* !DEV_BPF && !NETGRAPH_BPF */ /* * NOP stubs to allow bpf-using drivers to load and function. * @@ -1442,4 +1443,12 @@ bpf_filter(pc, p, wirelen, buflen) return -1; /* "no filter" behaviour */ } -#endif /* !BPF */ +int +bpf_validate(f, len) + const struct bpf_insn *f; + int len; +{ + return 0; /* false */ +} + +#endif /* !DEV_BPF && !NETGRAPH_BPF */ |