-/* $OpenBSD: bpf.c,v 1.129 2015/09/29 10:58:51 dlg Exp $ */
+/* $OpenBSD: bpf.c,v 1.130 2015/10/07 08:41:01 mpi Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
microtime(&tv);
KERNEL_LOCK();
- bpf_catchpacket(d, pkt, pktlen, slen, bcopy, &tv);
+ if (d->bd_bif != NULL) {
+ bpf_catchpacket(d, pkt, pktlen, slen,
+ bcopy, &tv);
+ }
KERNEL_UNLOCK();
if (d->bd_fildrop)
microtime(&tv);
KERNEL_LOCK();
- bpf_catchpacket(d, (u_char *)m, pktlen, slen,
- cpfn, &tv);
+ if (d->bd_bif != NULL) {
+ bpf_catchpacket(d, (u_char *)m, pktlen, slen,
+ cpfn, &tv);
+ }
KERNEL_UNLOCK();
if (d->bd_fildrop)