From 5a4a810c4f15e5238c74eb9b3923990293b61039 Mon Sep 17 00:00:00 2001 From: csjp Date: Sat, 3 Jun 2006 06:37:00 +0000 Subject: [PATCH] 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 --- sys/net/bpf.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/net/bpf.h b/sys/net/bpf.h index b2868c2c9071..83e91fecf6b0 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 { \