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)
This commit is contained in:
Peter Wemm 2001-01-29 13:26:14 +00:00
parent 2d0a97fbde
commit 5bb5f2c942
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71802
3 changed files with 18 additions and 5 deletions

View File

@ -779,7 +779,10 @@ msdosfs/msdosfs_lookup.c optional msdosfs
msdosfs/msdosfs_vfsops.c optional msdosfs
msdosfs/msdosfs_vnops.c optional msdosfs
net/bpf.c standard
net/bpf_filter.c count bpf
net/bpf_filter.c optional bpf
bpf.h standard \
compile-with "echo '#define NBPF 1' > bpf.h" \
no-obj no-implicit-rule before-depend
net/bridge.c optional bridge
net/bsd_comp.c optional ppp_bsdcomp
#net/hostcache.c standard

View File

@ -493,3 +493,4 @@ NDEVFSOVERFLOW opt_devfs.h
# various 'device presence' options.
DEV_SNP opt_snp.h
DEV_MCA opt_mca.h
DEV_BPF opt_bpf.h

View File

@ -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 */