summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index c04975c0f80..a035c440cdd 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.434 2016/06/10 20:33:29 vgross Exp $ */
+/* $OpenBSD: if.c,v 1.435 2016/07/12 09:33:13 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -618,9 +618,18 @@ if_input(struct ifnet *ifp, struct mbuf_list *ml)
#if NBPFILTER > 0
if_bpf = ifp->if_bpf;
if (if_bpf) {
- MBUF_LIST_FOREACH(ml, m)
- if (bpf_mtap_ether(if_bpf, m, BPF_DIRECTION_IN) != 0)
- m->m_flags |= M_FILDROP;
+ struct mbuf_list ml0;
+
+ ml_init(&ml0);
+ ml_enlist(&ml0, ml);
+ ml_init(ml);
+
+ while ((m = ml_dequeue(&ml0)) != NULL) {
+ if (bpf_mtap_ether(if_bpf, m, BPF_DIRECTION_IN))
+ m_freem(m);
+ else
+ ml_enqueue(ml, m);
+ }
}
#endif