diff options
author | 2016-05-10 06:37:15 +0000 | |
---|---|---|
committer | 2016-05-10 06:37:15 +0000 | |
commit | de3fab2cb97c8e556bff848ce54a7063d29b563d (patch) | |
tree | f45c1f880522320bb23dffdd090646bd53eada6a | |
parent | Oops: the caching of TCB address in single-threaded processes on archs with (diff) | |
download | wireguard-openbsd-de3fab2cb97c8e556bff848ce54a7063d29b563d.tar.xz wireguard-openbsd-de3fab2cb97c8e556bff848ce54a7063d29b563d.zip |
make bpf_mtap callers set the M_FILDROP flag if they care about it.
ok mpi@
-rw-r--r-- | sys/net/if.c | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_input.c | 16 |
2 files changed, 10 insertions, 11 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 3d912e7ee23..c0e232601c5 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.431 2016/05/08 08:58:27 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.432 2016/05/10 06:37:15 dlg Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -618,7 +618,8 @@ if_input(struct ifnet *ifp, struct mbuf_list *ml) if_bpf = ifp->if_bpf; if (if_bpf) { MBUF_LIST_FOREACH(ml, m) - bpf_mtap_ether(if_bpf, m, BPF_DIRECTION_IN); + if (bpf_mtap_ether(if_bpf, m, BPF_DIRECTION_IN) != 0) + m->m_flags |= M_FILDROP; } #endif diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 32bfac7e84a..7e4129bab09 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.176 2016/05/02 09:35:49 tb Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.177 2016/05/10 06:37:15 dlg Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -548,14 +548,12 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni, if (ifp->if_flags & IFF_DEBUG) ieee80211_input_print(ic, ifp, wh, rxi); #if NBPFILTER > 0 - if (ic->ic_rawbpf) - bpf_mtap(ic->ic_rawbpf, m, BPF_DIRECTION_IN); - /* - * Drop mbuf if it was filtered by bpf. Normally, this is - * done in ether_input() but IEEE 802.11 management frames - * are a special case. - */ - if (m->m_flags & M_FILDROP) { + if (bpf_mtap(ic->ic_rawbpf, m, BPF_DIRECTION_IN) != 0) { + /* + * Drop mbuf if it was filtered by bpf. Normally, + * this is done in ether_input() but IEEE 802.11 + * management frames are a special case. + */ m_freem(m); return; } |