From 24436414aab60dc84348ec54f23b324b4ae862a3 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 25 Mar 2006 22:41:49 +0000 Subject: allow bpf(4) to ignore packets based on their direction (inbound or outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@ --- sys/dev/ic/rt2560.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sys/dev/ic/rt2560.c') diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index 3f7b843e45b..29619229467 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560.c,v 1.12 2006/02/25 13:02:10 damien Exp $ */ +/* $OpenBSD: rt2560.c,v 1.13 2006/03/25 22:41:43 djm Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -1353,7 +1353,7 @@ rt2560_decryption_intr(struct rt2560_softc *sc) mb.m_len = sc->sc_txtap_len; mb.m_next = m; mb.m_pkthdr.len += mb.m_len; - bpf_mtap(sc->sc_drvbpf, &mb); + bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_IN); } #endif @@ -1464,7 +1464,7 @@ rt2560_beacon_expire(struct rt2560_softc *sc) #if NBPFILTER > 0 if (ic->ic_rawbpf != NULL) - bpf_mtap(ic->ic_rawbpf, data->m); + bpf_mtap(ic->ic_rawbpf, data->m, BPF_DIRECTION_OUT); #endif DPRINTFN(15, ("beacon expired\n")); @@ -1768,7 +1768,7 @@ rt2560_tx_mgt(struct rt2560_softc *sc, struct mbuf *m0, mb.m_len = sc->sc_txtap_len; mb.m_next = m0; mb.m_pkthdr.len += mb.m_len; - bpf_mtap(sc->sc_drvbpf, &mb); + bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_OUT); } #endif @@ -2018,7 +2018,7 @@ rt2560_tx_data(struct rt2560_softc *sc, struct mbuf *m0, mb.m_len = sc->sc_txtap_len; mb.m_next = m0; mb.m_pkthdr.len += mb.m_len; - bpf_mtap(sc->sc_drvbpf, &mb); + bpf_mtap(sc->sc_drvbpf, &mb, BPF_DIRECTION_OUT); } #endif @@ -2090,7 +2090,8 @@ rt2560_start(struct ifnet *ifp) m0->m_pkthdr.rcvif = NULL; #if NBPFILTER > 0 if (ic->ic_rawbpf != NULL) - bpf_mtap(ic->ic_rawbpf, m0); + bpf_mtap(ic->ic_rawbpf, m0, + BPF_DIRECTION_OUT); #endif if (rt2560_tx_mgt(sc, m0, ni) != 0) break; @@ -2108,14 +2109,15 @@ rt2560_start(struct ifnet *ifp) } #if NBPFILTER > 0 if (ifp->if_bpf != NULL) - bpf_mtap(ifp->if_bpf, m0); + bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT); #endif m0 = ieee80211_encap(ifp, m0, &ni); if (m0 == NULL) continue; #if NBPFILTER > 0 if (ic->ic_rawbpf != NULL) - bpf_mtap(ic->ic_rawbpf, m0); + bpf_mtap(ic->ic_rawbpf, m0, + BPF_DIRECTION_OUT); #endif if (rt2560_tx_data(sc, m0, ni) != 0) { if (ni != NULL) -- cgit v1.2.3