diff options
author | csjp <csjp@FreeBSD.org> | 2006-06-03 06:37:00 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2006-06-03 06:37:00 +0000 |
commit | 5a4a810c4f15e5238c74eb9b3923990293b61039 (patch) | |
tree | c2f55cfd0b33ab38d2d00494f12a12f35b291865 | |
parent | 730d02a45f4b59aa64e8b910976c8fc0249a1355 (diff) | |
download | FreeBSD-src-5a4a810c4f15e5238c74eb9b3923990293b61039.zip FreeBSD-src-5a4a810c4f15e5238c74eb9b3923990293b61039.tar.gz |
Make sure we don't try to dereference the the if_bpf pointer when bpf has
not been compiled into the the kernel.
Submitted by: benno
-rw-r--r-- | sys/net/bpf.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/bpf.h b/sys/net/bpf.h index b2868c2..83e91fe 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -630,7 +630,11 @@ static __inline int bpf_peers_present(struct bpf_if *bpf) { - return !LIST_EMPTY(&bpf->bif_dlist); +#if defined(DEV_BPF) || defined(NETGRAPH_BPF) + return (!LIST_EMPTY(&bpf->bif_dlist)); +#else + return (0); +#endif /* DEV_BPF || NETGRAPH_BPF */ } #define BPF_TAP(_ifp,_pkt,_pktlen) do { \ |