summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2006-03-25 22:41:49 +0000
committerDamien Miller <djm@cvs.openbsd.org>2006-03-25 22:41:49 +0000
commit24436414aab60dc84348ec54f23b324b4ae862a3 (patch)
treeee35283622a78eeac5656cb5661954771faf6520 /sys/dev/pci
parentd1265a1a72755bd0209950654a6df47287781241 (diff)
allow bpf(4) to ignore packets based on their direction (inbound or
outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_bce.c6
-rw-r--r--sys/dev/pci/if_bge.c6
-rw-r--r--sys/dev/pci/if_de.c13
-rw-r--r--sys/dev/pci/if_em.c6
-rw-r--r--sys/dev/pci/if_ipw.c10
-rw-r--r--sys/dev/pci/if_iwi.c10
-rw-r--r--sys/dev/pci/if_ixgb.c7
-rw-r--r--sys/dev/pci/if_lge.c6
-rw-r--r--sys/dev/pci/if_lmc.c9
-rw-r--r--sys/dev/pci/if_lmcvar.h6
-rw-r--r--sys/dev/pci/if_nfe.c6
-rw-r--r--sys/dev/pci/if_nge.c6
-rw-r--r--sys/dev/pci/if_pcn.c6
-rw-r--r--sys/dev/pci/if_san_obsd.c6
-rw-r--r--sys/dev/pci/if_sf.c7
-rw-r--r--sys/dev/pci/if_sis.c6
-rw-r--r--sys/dev/pci/if_sk.c6
-rw-r--r--sys/dev/pci/if_ste.c7
-rw-r--r--sys/dev/pci/if_stge.c6
-rw-r--r--sys/dev/pci/if_ti.c6
-rw-r--r--sys/dev/pci/if_tl.c7
-rw-r--r--sys/dev/pci/if_txp.c6
-rw-r--r--sys/dev/pci/if_vge.c6
-rw-r--r--sys/dev/pci/if_vic.c6
-rw-r--r--sys/dev/pci/if_vr.c7
-rw-r--r--sys/dev/pci/if_wb.c7
-rw-r--r--sys/dev/pci/musycc.c6
27 files changed, 97 insertions, 89 deletions
diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c
index 9ff8419da63..c0ece2f292a 100644
--- a/sys/dev/pci/if_bce.c
+++ b/sys/dev/pci/if_bce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bce.c,v 1.11 2006/02/24 00:57:49 brad Exp $ */
+/* $OpenBSD: if_bce.c,v 1.12 2006/03/25 22:41:44 djm Exp $ */
/* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */
/*
@@ -654,7 +654,7 @@ bce_start(ifp)
#if NBPFILTER > 0
/* Pass the packet to any BPF listeners. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif /* NBPFILTER > 0 */
}
if (txsfree == 0) {
@@ -853,7 +853,7 @@ bce_rxintr(sc)
* pass it up the stack if it's for us.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif /* NBPFILTER > 0 */
/* Pass it on. */
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 7cde80b0e5e..053b38aa2e6 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.137 2006/03/16 02:40:16 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.138 2006/03/25 22:41:44 djm Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -2309,7 +2309,7 @@ bge_rxeof(struct bge_softc *sc)
* Handle BPF listeners. Let the BPF user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
#ifdef BGE_CHECKSUM
@@ -2838,7 +2838,7 @@ bge_start(struct ifnet *ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
}
if (pkts == 0)
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c
index 9f24873cc93..5b459888505 100644
--- a/sys/dev/pci/if_de.c
+++ b/sys/dev/pci/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.87 2005/11/07 00:03:16 brad Exp $ */
+/* $OpenBSD: if_de.c,v 1.88 2006/03/25 22:41:44 djm Exp $ */
/* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */
/*-
@@ -3322,10 +3322,11 @@ tulip_rx_intr(
#if NBPFILTER > 0
if (sc->tulip_bpf != NULL) {
- if (me == ms)
- bpf_tap(sc->tulip_if.if_bpf, mtod(ms, caddr_t), total_len);
- else
- bpf_mtap(sc->tulip_if.if_bpf, ms);
+ if (me == ms) {
+ bpf_tap(sc->tulip_if.if_bpf, mtod(ms, caddr_t),
+ total_len, BPF_DIRECTION_IN);
+ } else
+ bpf_mtap(sc->tulip_if.if_bpf, ms, BPF_DIRECTION_IN);
}
#endif
sc->tulip_flags |= TULIP_RXACT;
@@ -3543,7 +3544,7 @@ tulip_tx_intr(
sc->tulip_txmaps[sc->tulip_txmaps_free++] = map;
#if NBPFILTER > 0
if (sc->tulip_bpf != NULL)
- bpf_mtap(sc->tulip_if.if_bpf, m);
+ bpf_mtap(sc->tulip_if.if_bpf, m, BPF_DIRECTION_OUT);
#endif
m_freem(m);
#if defined(TULIP_DEBUG)
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index bfc32d6267d..9272e58372d 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.109 2006/02/24 06:09:44 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.110 2006/03/25 22:41:44 djm Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -417,7 +417,7 @@ em_start(struct ifnet *ifp)
#if NBPFILTER > 0
/* Send a copy of the frame to the BPF listener */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
/* Set timeout in case hardware has problems transmitting */
@@ -2425,7 +2425,7 @@ em_process_receive_interrupts(struct em_softc *sc, int count)
* user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
ether_input_mbuf(ifp, m);
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index d4e977bdb19..43e048c5f65 100644
--- a/sys/dev/pci/if_ipw.c
+++ b/sys/dev/pci/if_ipw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ipw.c,v 1.55 2006/02/26 19:14:39 damien Exp $ */
+/* $OpenBSD: if_ipw.c,v 1.56 2006/03/25 22:41:45 djm Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -915,7 +915,7 @@ ipw_data_intr(struct ipw_softc *sc, struct ipw_status *status,
mb.m_len = sc->sc_rxtap_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
@@ -1173,7 +1173,7 @@ ipw_tx_start(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni)
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_OUT);
}
#endif
@@ -1338,7 +1338,7 @@ ipw_start(struct ifnet *ifp)
#if NBPFILTER > 0
if (ifp->if_bpf != NULL)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
m = ieee80211_encap(ifp, m, &ni);
@@ -1347,7 +1347,7 @@ ipw_start(struct ifnet *ifp)
#if NBPFILTER > 0
if (ic->ic_rawbpf != NULL)
- bpf_mtap(ic->ic_rawbpf, m);
+ bpf_mtap(ic->ic_rawbpf, m, BPF_DIRECTION_OUT);
#endif
if (ipw_tx_start(ifp, m, ni) != 0) {
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index a81b2b6c057..11f00cd9e6c 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwi.c,v 1.60 2006/02/26 19:14:40 damien Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.61 2006/03/25 22:41:45 djm Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -877,7 +877,7 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_buf *buf, int i,
mb.m_len = sc->sc_rxtap_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
@@ -1145,7 +1145,7 @@ iwi_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni)
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
@@ -1276,7 +1276,7 @@ iwi_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);
@@ -1285,7 +1285,7 @@ iwi_start(struct ifnet *ifp)
#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 (iwi_tx_start(ifp, m0, ni) != 0) {
diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c
index 0477a19e103..c55909cb055 100644
--- a/sys/dev/pci/if_ixgb.c
+++ b/sys/dev/pci/if_ixgb.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_ixgb.c,v 1.10 2006/03/05 01:13:37 brad Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.11 2006/03/25 22:41:45 djm Exp $ */
#include <dev/pci/if_ixgb.h>
@@ -323,7 +323,7 @@ ixgb_start(struct ifnet *ifp)
#if NBPFILTER > 0
/* Send a copy of the frame to the BPF listener */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
/* Set timeout in case hardware has problems transmitting */
@@ -1753,7 +1753,8 @@ ixgb_process_receive_interrupts(struct ixgb_softc *sc, int count)
* user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, sc->fmp);
+ bpf_mtap(ifp->if_bpf, sc->fmp,
+ BPF_DIRECTION_IN);
#endif
ixgb_receive_checksum(sc, current_desc,
diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c
index 540a03ea3ca..2ef5f4dd960 100644
--- a/sys/dev/pci/if_lge.c
+++ b/sys/dev/pci/if_lge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lge.c,v 1.37 2006/03/20 16:15:03 brad Exp $ */
+/* $OpenBSD: if_lge.c,v 1.38 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -956,7 +956,7 @@ lge_rxeof(struct lge_softc *sc, int cnt)
* Handle BPF listeners. Let the BPF user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* Do IP checksum checking. */
@@ -1212,7 +1212,7 @@ lge_start(struct ifnet *ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
}
if (pkts == 0)
diff --git a/sys/dev/pci/if_lmc.c b/sys/dev/pci/if_lmc.c
index 86b02a7abf9..a3a570bbc8b 100644
--- a/sys/dev/pci/if_lmc.c
+++ b/sys/dev/pci/if_lmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lmc.c,v 1.21 2006/03/16 21:36:58 miod Exp $ */
+/* $OpenBSD: if_lmc.c,v 1.22 2006/03/25 22:41:45 djm Exp $ */
/* $NetBSD: if_lmc.c,v 1.1 1999/03/25 03:32:43 explorer Exp $ */
/*-
@@ -616,9 +616,10 @@ lmc_rx_intr(lmc_softc_t * const sc)
#if NBPFILTER > 0
if (sc->lmc_bpf != NULL) {
if (me == ms)
- LMC_BPF_TAP(sc, mtod(ms, caddr_t), total_len);
+ LMC_BPF_TAP(sc, mtod(ms, caddr_t),
+ total_len, BPF_DIRECTION_IN);
else
- LMC_BPF_MTAP(sc, ms);
+ LMC_BPF_MTAP(sc, ms, BPF_DIRECTION_IN);
}
#endif
sc->lmc_flags |= LMC_RXACT;
@@ -772,7 +773,7 @@ lmc_tx_intr(lmc_softc_t * const sc)
sc->lmc_txmaps[sc->lmc_txmaps_free++] = map;
#if NBPFILTER > 0
if (sc->lmc_bpf != NULL)
- LMC_BPF_MTAP(sc, m);
+ LMC_BPF_MTAP(sc, m, BPF_DIRECTION_OUT);
#endif
m_freem(m);
#if defined(LMC_DEBUG)
diff --git a/sys/dev/pci/if_lmcvar.h b/sys/dev/pci/if_lmcvar.h
index 812c4c976ea..7e9d2014251 100644
--- a/sys/dev/pci/if_lmcvar.h
+++ b/sys/dev/pci/if_lmcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_lmcvar.h,v 1.9 2006/03/16 21:36:58 miod Exp $ */
+/* $OpenBSD: if_lmcvar.h,v 1.10 2006/03/25 22:41:45 djm Exp $ */
/* $NetBSD: if_lmcvar.h,v 1.1 1999/03/25 03:32:43 explorer Exp $ */
/*-
@@ -544,8 +544,8 @@ extern struct cfdriver lmc_cd;
* it does add yet more conditional code to this driver. Sigh.
*/
#if !defined(LMC_BPF_MTAP) && NBPFILTER > 0
-#define LMC_BPF_MTAP(sc, m) bpf_mtap((sc)->lmc_bpf, m)
-#define LMC_BPF_TAP(sc, p, l) bpf_tap((sc)->lmc_bpf, p, l)
+#define LMC_BPF_MTAP(sc, m, d) bpf_mtap((sc)->lmc_bpf, m, d)
+#define LMC_BPF_TAP(sc, p, l, d) bpf_tap((sc)->lmc_bpf, p, l, d)
#define LMC_BPF_ATTACH(sc) bpfattach(&(sc)->lmc_bpf, &(sc)->lmc_sppp.pp_if, DLT_PPP, PPP_HEADER_LEN)
#endif
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c
index bec5ec4070c..00b9c8017f8 100644
--- a/sys/dev/pci/if_nfe.c
+++ b/sys/dev/pci/if_nfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nfe.c,v 1.52 2006/03/02 09:04:00 jsg Exp $ */
+/* $OpenBSD: if_nfe.c,v 1.53 2006/03/25 22:41:45 djm Exp $ */
/*-
* Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr>
@@ -753,7 +753,7 @@ nfe_rxeof(struct nfe_softc *sc)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
ifp->if_ipackets++;
ether_input_mbuf(ifp, m);
@@ -979,7 +979,7 @@ nfe_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
}
if (sc->txq.cur == old) /* nothing sent */
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c
index b42edce6139..8fcb70f4099 100644
--- a/sys/dev/pci/if_nge.c
+++ b/sys/dev/pci/if_nge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nge.c,v 1.50 2006/03/04 04:40:57 brad Exp $ */
+/* $OpenBSD: if_nge.c,v 1.51 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -1340,7 +1340,7 @@ nge_rxeof(sc)
* Handle BPF listeners. Let the BPF user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* Do IP checksum checking. */
@@ -1699,7 +1699,7 @@ nge_start(ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
}
if (pkts == 0)
diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c
index b0f9c907451..1b112af8961 100644
--- a/sys/dev/pci/if_pcn.c
+++ b/sys/dev/pci/if_pcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pcn.c,v 1.9 2006/03/19 02:50:54 brad Exp $ */
+/* $OpenBSD: if_pcn.c,v 1.10 2006/03/25 22:41:45 djm Exp $ */
/* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */
/*
@@ -1009,7 +1009,7 @@ pcn_start(struct ifnet *ifp)
#if NBPFILTER > 0
/* Pass the packet to any BPF listeners. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif /* NBPFILTER > 0 */
}
@@ -1472,7 +1472,7 @@ pcn_rxintr(struct pcn_softc *sc)
#if NBPFILTER > 0
/* Pass this up to any BPF listeners. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif /* NBPFILTER > 0 */
/* Pass it on. */
diff --git a/sys/dev/pci/if_san_obsd.c b/sys/dev/pci/if_san_obsd.c
index 26ad019f8ff..f964df216f8 100644
--- a/sys/dev/pci/if_san_obsd.c
+++ b/sys/dev/pci/if_san_obsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_san_obsd.c,v 1.10 2005/12/13 05:56:22 canacar Exp $ */
+/* $OpenBSD: if_san_obsd.c,v 1.11 2006/03/25 22:41:45 djm Exp $ */
/*-
* Copyright (c) 2001-2004 Sangoma Technologies (SAN)
@@ -186,7 +186,7 @@ wanpipe_generic_start(struct ifnet *ifp)
/* report the packet to BPF if present and attached */
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, opkt);
+ bpf_mtap(ifp->if_bpf, opkt, BPF_DIRECTION_OUT);
#endif /* NBPFILTER > 0 */
if (wan_mbuf_to_buffer(&opkt)) {
@@ -379,7 +379,7 @@ wanpipe_generic_input(struct ifnet *ifp, struct mbuf *m)
m->m_pkthdr.rcvif = ifp;
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif /* NBPFILTER > 0 */
ifp->if_ipackets ++;
sppp_input(ifp, m);
diff --git a/sys/dev/pci/if_sf.c b/sys/dev/pci/if_sf.c
index 289b3470ede..e7b87448301 100644
--- a/sys/dev/pci/if_sf.c
+++ b/sys/dev/pci/if_sf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sf.c,v 1.35 2006/03/20 16:15:03 brad Exp $ */
+/* $OpenBSD: if_sf.c,v 1.36 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -867,7 +867,7 @@ void sf_rxeof(sc)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* pass it on. */
@@ -1240,7 +1240,8 @@ void sf_start(ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, cur_tx->sf_mbuf);
+ bpf_mtap(ifp->if_bpf, cur_tx->sf_mbuf,
+ BPF_DIRECTION_OUT);
#endif
SF_INC(i, SF_TX_DLIST_CNT);
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c
index 72d2747a734..b1369c59944 100644
--- a/sys/dev/pci/if_sis.c
+++ b/sys/dev/pci/if_sis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.65 2006/03/25 20:09:17 brad Exp $ */
+/* $OpenBSD: if_sis.c,v 1.66 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -1351,7 +1351,7 @@ sis_rxeof(struct sis_softc *sc)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* pass it on. */
@@ -1614,7 +1614,7 @@ sis_start(struct ifnet *ifp)
*/
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
}
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c
index b6c4b8289ee..3c5f1f74e31 100644
--- a/sys/dev/pci/if_sk.c
+++ b/sys/dev/pci/if_sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sk.c,v 1.95 2006/02/13 01:23:05 brad Exp $ */
+/* $OpenBSD: if_sk.c,v 1.96 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1800,7 +1800,7 @@ sk_start(struct ifnet *ifp)
*/
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
}
if (pkts == 0)
@@ -1926,7 +1926,7 @@ sk_rxeof(struct sk_if_softc *sc_if)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* pass it on. */
diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c
index b339229cecc..ae7aa22e746 100644
--- a/sys/dev/pci/if_ste.c
+++ b/sys/dev/pci/if_ste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ste.c,v 1.34 2005/11/07 02:57:45 brad Exp $ */
+/* $OpenBSD: if_ste.c,v 1.35 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -705,7 +705,7 @@ void ste_rxeof(sc)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* pass it on. */
@@ -1499,7 +1499,8 @@ void ste_start(ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, cur_tx->ste_mbuf);
+ bpf_mtap(ifp->if_bpf, cur_tx->ste_mbuf,
+ BPF_DIRECTION_OUT);
#endif
STE_INC(idx, STE_TX_LIST_CNT);
diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c
index 53e767c4ff8..c40416d5f9c 100644
--- a/sys/dev/pci/if_stge.c
+++ b/sys/dev/pci/if_stge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stge.c,v 1.22 2005/09/11 18:17:08 mickey Exp $ */
+/* $OpenBSD: if_stge.c,v 1.23 2006/03/25 22:41:45 djm Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
@@ -799,7 +799,7 @@ stge_start(struct ifnet *ifp)
* Pass the packet to any BPF listeners.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif /* NBPFILTER > 0 */
}
@@ -1234,7 +1234,7 @@ stge_rxintr(struct stge_softc *sc)
* pass if up the stack if it's for us.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif /* NBPFILTER > 0 */
/* Pass it on. */
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c
index 3150672c1d7..dcb333b74c2 100644
--- a/sys/dev/pci/if_ti.c
+++ b/sys/dev/pci/if_ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ti.c,v 1.78 2006/03/16 02:32:37 brad Exp $ */
+/* $OpenBSD: if_ti.c,v 1.79 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1816,7 +1816,7 @@ ti_rxeof(struct ti_softc *sc)
* Handle BPF listeners. Let the BPF user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
if ((cur_rx->ti_ip_cksum ^ 0xffff) == 0)
@@ -2205,7 +2205,7 @@ ti_start(struct ifnet *ifp)
*/
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
}
if (pkts == 0)
diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c
index 7ccc3ac1d92..6aadabe336d 100644
--- a/sys/dev/pci/if_tl.c
+++ b/sys/dev/pci/if_tl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tl.c,v 1.39 2006/03/20 16:15:03 brad Exp $ */
+/* $OpenBSD: if_tl.c,v 1.40 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1166,7 +1166,7 @@ int tl_intvec_rxeof(xsc, type)
* since it can be used again later.
*/
if (ifp->if_bpf) {
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
}
#endif
/* pass it on. */
@@ -1595,7 +1595,8 @@ void tl_start(ifp)
*/
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, cur_tx->tl_mbuf);
+ bpf_mtap(ifp->if_bpf, cur_tx->tl_mbuf,
+ BPF_DIRECTION_OUT);
#endif
}
diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c
index faa336966e8..ce0e23be18a 100644
--- a/sys/dev/pci/if_txp.c
+++ b/sys/dev/pci/if_txp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_txp.c,v 1.79 2006/02/16 21:02:34 brad Exp $ */
+/* $OpenBSD: if_txp.c,v 1.80 2006/03/25 22:41:45 djm Exp $ */
/*
* Copyright (c) 2001
@@ -734,7 +734,7 @@ txp_rx_reclaim(sc, r, dma)
* Handle BPF listeners. Let the BPF user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
if (rxd->rx_stat & htole32(RX_STAT_IPCKSUMBAD))
@@ -1521,7 +1521,7 @@ txp_start(ifp)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
txd->tx_flags |= TX_FLAGS_VALID;
diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c
index 0fbb06d8d33..39852eed325 100644
--- a/sys/dev/pci/if_vge.c
+++ b/sys/dev/pci/if_vge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vge.c,v 1.19 2006/03/20 16:15:03 brad Exp $ */
+/* $OpenBSD: if_vge.c,v 1.20 2006/03/25 22:41:46 djm Exp $ */
/* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */
/*
* Copyright (c) 2004
@@ -1110,7 +1110,7 @@ vge_rxeof(struct vge_softc *sc)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
ether_input_mbuf(ifp, m);
@@ -1435,7 +1435,7 @@ vge_start(struct ifnet *ifp)
*/
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
if (vge_encap(sc, m_head, idx)) {
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c
index 2a4b5d8260a..6e0076f4cee 100644
--- a/sys/dev/pci/if_vic.c
+++ b/sys/dev/pci/if_vic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vic.c,v 1.5 2006/03/04 03:33:05 brad Exp $ */
+/* $OpenBSD: if_vic.c,v 1.6 2006/03/25 22:41:46 djm Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -351,7 +351,7 @@ vic_rx_proc(struct vic_softc *sc)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
ether_input_mbuf(ifp, m);
@@ -502,7 +502,7 @@ vic_start(struct ifnet *ifp)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
if ((error = vic_tx_start(sc, m)) != 0)
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index 548b3446fee..25c331e20ee 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vr.c,v 1.60 2006/03/20 16:15:03 brad Exp $ */
+/* $OpenBSD: if_vr.c,v 1.61 2006/03/25 22:41:46 djm Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1022,7 +1022,7 @@ vr_rxeof(struct vr_softc *sc)
* Handle BPF listeners. Let the BPF user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_IN);
#endif
/* pass it on. */
ether_input_mbuf(ifp, m0);
@@ -1345,7 +1345,8 @@ vr_start(struct ifnet *ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, cur_tx->vr_mbuf);
+ bpf_mtap(ifp->if_bpf, cur_tx->vr_mbuf,
+ BPF_DIRECTION_OUT);
#endif
cur_tx = cur_tx->vr_nextdesc;
}
diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c
index 995e27e97ac..6fcdd2a6ff3 100644
--- a/sys/dev/pci/if_wb.c
+++ b/sys/dev/pci/if_wb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wb.c,v 1.33 2006/03/20 16:15:03 brad Exp $ */
+/* $OpenBSD: if_wb.c,v 1.34 2006/03/25 22:41:46 djm Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1068,7 +1068,7 @@ void wb_rxeof(sc)
* Handle BPF listeners. Let the BPF user see the packet.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* pass it on. */
ether_input_mbuf(ifp, m);
@@ -1411,7 +1411,8 @@ void wb_start(ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, cur_tx->wb_mbuf);
+ bpf_mtap(ifp->if_bpf, cur_tx->wb_mbuf,
+ BPF_DIRECTION_OUT);
#endif
}
diff --git a/sys/dev/pci/musycc.c b/sys/dev/pci/musycc.c
index a2d0ad2dc19..d347381afa0 100644
--- a/sys/dev/pci/musycc.c
+++ b/sys/dev/pci/musycc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: musycc.c,v 1.14 2006/01/27 13:57:03 claudio Exp $ */
+/* $OpenBSD: musycc.c,v 1.15 2006/03/25 22:41:46 djm Exp $ */
/*
* Copyright (c) 2004,2005 Internet Business Solutions AG, Zurich, Switzerland
@@ -1103,7 +1103,7 @@ musycc_start(struct ifnet *ifp)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
/* now we are committed to transmit the packet */
@@ -1213,7 +1213,7 @@ musycc_rxeom(struct musycc_group *mg, int channel, int forcekick)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* pass it on. */