summaryrefslogtreecommitdiff
path: root/sys/dev/ic
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/ic
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/ic')
-rw-r--r--sys/dev/ic/am7990.c6
-rw-r--r--sys/dev/ic/an.c10
-rw-r--r--sys/dev/ic/ath.c10
-rw-r--r--sys/dev/ic/atw.c10
-rw-r--r--sys/dev/ic/awi.c18
-rw-r--r--sys/dev/ic/dc.c6
-rw-r--r--sys/dev/ic/dp8390.c6
-rw-r--r--sys/dev/ic/elink3.c6
-rw-r--r--sys/dev/ic/fxp.c7
-rw-r--r--sys/dev/ic/gem.c6
-rw-r--r--sys/dev/ic/hme.c6
-rw-r--r--sys/dev/ic/i82596.c6
-rw-r--r--sys/dev/ic/if_wi.c9
-rw-r--r--sys/dev/ic/lemac.c6
-rw-r--r--sys/dev/ic/midway.c8
-rw-r--r--sys/dev/ic/mtd8xx.c6
-rw-r--r--sys/dev/ic/pdq_ifsubr.c6
-rw-r--r--sys/dev/ic/pdqvar.h10
-rw-r--r--sys/dev/ic/re.c6
-rw-r--r--sys/dev/ic/rln.c6
-rw-r--r--sys/dev/ic/rt2560.c18
-rw-r--r--sys/dev/ic/rt2661.c16
-rw-r--r--sys/dev/ic/rtl81x9.c7
-rw-r--r--sys/dev/ic/rtw.c11
-rw-r--r--sys/dev/ic/smc83c170.c6
-rw-r--r--sys/dev/ic/smc90cx6.c6
-rw-r--r--sys/dev/ic/smc91cxx.c6
-rw-r--r--sys/dev/ic/tropic.c8
-rw-r--r--sys/dev/ic/xl.c10
29 files changed, 124 insertions, 118 deletions
diff --git a/sys/dev/ic/am7990.c b/sys/dev/ic/am7990.c
index 3ed233a2a5e..5afa5991fc4 100644
--- a/sys/dev/ic/am7990.c
+++ b/sys/dev/ic/am7990.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: am7990.c,v 1.39 2005/11/07 03:20:00 brad Exp $ */
+/* $OpenBSD: am7990.c,v 1.40 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: am7990.c,v 1.22 1996/10/13 01:37:19 christos Exp $ */
/*-
@@ -474,7 +474,7 @@ am7990_read(sc, boff, len)
* If so, hand off the raw packet to BPF.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
#ifdef LANCE_REVC_BUG
@@ -780,7 +780,7 @@ am7990_start(ifp)
* before we commit it to the wire.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
/*
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c
index 5cc9b48d1b4..35f28c40d3e 100644
--- a/sys/dev/ic/an.c
+++ b/sys/dev/ic/an.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: an.c,v 1.48 2006/03/04 04:43:28 brad Exp $ */
+/* $OpenBSD: an.c,v 1.49 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: an.c,v 1.34 2005/06/20 02:49:18 atatat Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -452,7 +452,7 @@ an_rxeof(struct an_softc *sc)
mb.m_len = sizeof(sc->sc_rxtapu);
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 /* NPBFILTER > 0 */
@@ -1131,7 +1131,7 @@ an_start(struct ifnet *ifp)
ifp->if_opackets++;
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
if ((m = ieee80211_encap(ifp, m, &ni)) == NULL) {
ifp->if_oerrors++;
@@ -1141,7 +1141,7 @@ an_start(struct ifnet *ifp)
ieee80211_release_node(ic, ni);
#if NBPFILTER > 0
if (ic->ic_rawbpf)
- bpf_mtap(ic->ic_rawbpf, m);
+ bpf_mtap(ic->ic_rawbpf, m, BPF_DIRECTION_OUT);
#endif
wh = mtod(m, struct ieee80211_frame *);
@@ -1205,7 +1205,7 @@ an_start(struct ifnet *ifp)
mb.m_len = sizeof(sc->sc_txtapu);
mb.m_next = m;
mb.m_pkthdr.len += mb.m_len;
- bpf_mtap(sc->sc_drvbpf, m);
+ bpf_mtap(sc->sc_drvbpf, m, BPF_DIRECTION_OUT);
}
#endif
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index ca7b959ed7b..2cdb1186f2b 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.46 2006/02/20 20:12:13 damien Exp $ */
+/* $OpenBSD: ath.c,v 1.47 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -936,7 +936,7 @@ ath_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
/*
@@ -2008,7 +2008,7 @@ ath_rx_proc(void *arg, int npending)
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
@@ -2378,7 +2378,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
#if NBPFILTER > 0
if (ic->ic_rawbpf)
- bpf_mtap(ic->ic_rawbpf, m0);
+ bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
if (sc->sc_drvbpf) {
struct mbuf mb;
@@ -2399,7 +2399,7 @@ ath_tx_start(struct ath_softc *sc, 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
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c
index 950ce86bba1..0ee9e7938f1 100644
--- a/sys/dev/ic/atw.c
+++ b/sys/dev/ic/atw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atw.c,v 1.44 2006/03/22 19:39:06 deraadt Exp $ */
+/* $OpenBSD: atw.c,v 1.45 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */
/*-
@@ -3219,7 +3219,7 @@ atw_rxintr(struct atw_softc *sc)
mb.m_len = tap->ar_ihdr.it_len;
mb.m_next = m;
mb.m_pkthdr.len += mb.m_len;
- bpf_mtap(sc->sc_radiobpf, &mb);
+ bpf_mtap(sc->sc_radiobpf, &mb, BPF_DIRECTION_IN);
}
#endif /* NPBFILTER > 0 */
@@ -3498,7 +3498,7 @@ atw_start(struct ifnet *ifp)
break;
#if NBPFILTER > 0
if (ifp->if_bpf != NULL)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif /* NBPFILTER > 0 */
if ((m0 = ieee80211_encap(ifp, m0, &ni)) == NULL) {
ifp->if_oerrors++;
@@ -3543,7 +3543,7 @@ atw_start(struct ifnet *ifp)
* Pass the packet to any BPF listeners.
*/
if (ic->ic_rawbpf != NULL)
- bpf_mtap(ic->ic_rawbpf, m0);
+ bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
if (sc->sc_radiobpf != NULL) {
struct mbuf mb;
@@ -3560,7 +3560,7 @@ atw_start(struct ifnet *ifp)
mb.m_len = tap->at_ihdr.it_len;
mb.m_next = m0;
mb.m_pkthdr.len += mb.m_len;
- bpf_mtap(sc->sc_radiobpf, &mb);
+ bpf_mtap(sc->sc_radiobpf, &mb, BPF_DIRECTION_OUT);
}
#endif /* NBPFILTER > 0 */
diff --git a/sys/dev/ic/awi.c b/sys/dev/ic/awi.c
index 4d14123f95d..ddd410b227b 100644
--- a/sys/dev/ic/awi.c
+++ b/sys/dev/ic/awi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: awi.c,v 1.20 2006/01/04 06:04:41 canacar Exp $ */
+/* $OpenBSD: awi.c,v 1.21 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: awi.c,v 1.26 2000/07/21 04:48:55 onoe Exp $ */
/*-
@@ -223,18 +223,18 @@ int awi_dump_len = 28;
#define AWI_BPF_NORM 0
#define AWI_BPF_RAW 1
#ifdef __FreeBSD__
-#define AWI_BPF_MTAP(sc, m, raw) do { \
+#define AWI_BPF_MTAP(sc, m, raw, dir) do { \
if ((sc)->sc_ifp->if_bpf && (sc)->sc_rawbpf == (raw)) \
bpf_mtap((sc)->sc_ifp, (m)); \
} while (0);
#else
-#define AWI_BPF_MTAP(sc, m, raw) do { \
+#define AWI_BPF_MTAP(sc, m, raw, dir) do { \
if ((sc)->sc_ifp->if_bpf && (sc)->sc_rawbpf == (raw)) \
- bpf_mtap((sc)->sc_ifp->if_bpf, (m)); \
+ bpf_mtap((sc)->sc_ifp->if_bpf, (m), dir); \
} while (0);
#endif
#else
-#define AWI_BPF_MTAP(sc, m, raw)
+#define AWI_BPF_MTAP(sc, m, raw, dir)
#endif
#ifndef llc_snap
@@ -994,7 +994,7 @@ awi_start(ifp)
break;
}
IFQ_DEQUEUE(&ifp->if_snd, m0);
- AWI_BPF_MTAP(sc, m0, AWI_BPF_NORM);
+ AWI_BPF_MTAP(sc, m0, AWI_BPF_NORM, BPF_DIRECTION_OUT);
m0 = awi_fix_txhdr(sc, m0);
if (sc->sc_wep_algo != NULL && m0 != NULL)
m0 = awi_wep_encrypt(sc, m0, 1);
@@ -1008,7 +1008,7 @@ awi_start(ifp)
if (awi_dump)
awi_dump_pkt(sc, m0, -1);
#endif
- AWI_BPF_MTAP(sc, m0, AWI_BPF_RAW);
+ AWI_BPF_MTAP(sc, m0, AWI_BPF_RAW, BPF_DIRECTION_OUT);
len = 0;
for (m = m0; m != NULL; m = m->m_next) {
awi_write_bytes(sc, frame + len, mtod(m, u_int8_t *),
@@ -1222,7 +1222,7 @@ awi_input(sc, m, rxts, rssi)
/* trim CRC here for WEP can find its own CRC at the end of packet. */
m_adj(m, -ETHER_CRC_LEN);
- AWI_BPF_MTAP(sc, m, AWI_BPF_RAW);
+ AWI_BPF_MTAP(sc, m, AWI_BPF_RAW, BPF_DIRECTION_IN);
wh = mtod(m, struct ieee80211_frame *);
if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) !=
IEEE80211_FC0_VERSION_0) {
@@ -1274,7 +1274,7 @@ awi_input(sc, m, rxts, rssi)
}
ifp->if_ipackets++;
#if !(defined(__FreeBSD__) && __FreeBSD__ >= 4)
- AWI_BPF_MTAP(sc, m, AWI_BPF_NORM);
+ AWI_BPF_MTAP(sc, m, AWI_BPF_NORM, BPF_DIRECTION_IN);
#endif
#ifdef __NetBSD__
(*ifp->if_input)(ifp, m);
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index 928d9c16b22..df227d51e98 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.91 2006/01/28 10:08:38 brad Exp $ */
+/* $OpenBSD: dc.c,v 1.92 2006/03/25 22:41:42 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -2269,7 +2269,7 @@ dc_rxeof(sc)
ifp->if_ipackets++;
#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);
}
@@ -2780,7 +2780,7 @@ dc_start(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 (sc->dc_flags & DC_TX_ONE) {
ifp->if_flags |= IFF_OACTIVE;
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c
index 2db24368ebf..12a6f0533ae 100644
--- a/sys/dev/ic/dp8390.c
+++ b/sys/dev/ic/dp8390.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390.c,v 1.30 2006/02/24 23:56:19 brad Exp $ */
+/* $OpenBSD: dp8390.c,v 1.31 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */
/*
@@ -452,7 +452,7 @@ outloop:
#if NBPFILTER > 0
/* Tap off here if there is a BPF listener. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
/* txb_new points to next open buffer slot. */
@@ -929,7 +929,7 @@ dp8390_read(sc, buf, len)
* If so, hand off the raw packet to bpf.
*/
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/ic/elink3.c b/sys/dev/ic/elink3.c
index 559c823ddc5..f21dd9a2e87 100644
--- a/sys/dev/ic/elink3.c
+++ b/sys/dev/ic/elink3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elink3.c,v 1.66 2005/11/21 18:16:39 millert Exp $ */
+/* $OpenBSD: elink3.c,v 1.67 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */
/*
@@ -1025,7 +1025,7 @@ startagain:
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
/*
@@ -1321,7 +1321,7 @@ again:
* If so, hand off the raw packet to BPF.
*/
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/ic/fxp.c b/sys/dev/ic/fxp.c
index e322692567a..0873810805b 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.76 2006/03/04 03:34:38 brad Exp $ */
+/* $OpenBSD: fxp.c,v 1.77 2006/03/25 22:41:42 djm Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -787,7 +787,7 @@ fxp_start(ifp)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
FXP_MBUF_SYNC(sc, txs->tx_map, BUS_DMASYNC_PREWRITE);
@@ -973,7 +973,8 @@ rcvloop:
total_len;
#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 */
ether_input_mbuf(ifp, m);
}
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index a9037c1d07a..e22f9468f02 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gem.c,v 1.56 2006/02/21 19:46:52 brad Exp $ */
+/* $OpenBSD: gem.c,v 1.57 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
@@ -976,7 +976,7 @@ gem_rint(sc)
* pass it up the stack if its for us.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif /* NPBFILTER > 0 */
/* Pass it on. */
@@ -1656,7 +1656,7 @@ gem_start(ifp)
* packet before we commit it to the wire.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
/*
diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c
index 6b73d056cfe..77eb4d1023e 100644
--- a/sys/dev/ic/hme.c
+++ b/sys/dev/ic/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.41 2006/01/12 15:06:12 brad Exp $ */
+/* $OpenBSD: hme.c,v 1.42 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */
/*-
@@ -656,7 +656,7 @@ hme_start(ifp)
* packet before we commit it to the wire.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
if (hme_encap(sc, m, &bix)) {
@@ -879,7 +879,7 @@ hme_rint(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);
diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c
index c163fff852e..0d8caf3803d 100644
--- a/sys/dev/ic/i82596.c
+++ b/sys/dev/ic/i82596.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82596.c,v 1.25 2005/01/15 05:24:11 brad Exp $ */
+/* $OpenBSD: i82596.c,v 1.26 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */
/*-
@@ -1127,7 +1127,7 @@ i82596_readframe(sc, num)
#if NBPFILTER > 0
/* Check for a BPF filter; if so, hand it up. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif /* NBPFILTER > 0 */
/*
@@ -1258,7 +1258,7 @@ i82596_start(ifp)
#if NBPFILTER > 0
/* Tap off here if there is a BPF listener. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
if (m0->m_pkthdr.len > IE_TBUF_SIZE)
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 9ca7996aab3..77f93be7a27 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.126 2005/12/03 21:11:47 brad Exp $ */
+/* $OpenBSD: if_wi.c,v 1.127 2006/03/25 22:41:43 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -105,7 +105,6 @@
#include <crypto/arc4.h>
-#define BPF_MTAP(if,mbuf) bpf_mtap((if)->if_bpf, (mbuf))
#define BPFATTACH(if_bpf,if,dlt,sz)
#define STATIC
@@ -128,7 +127,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.126 2005/12/03 21:11:47 brad Exp $";
+ "$OpenBSD: if_wi.c,v 1.127 2006/03/25 22:41:43 djm Exp $";
#endif /* lint */
#ifdef foo
@@ -829,7 +828,7 @@ wi_rxeof(struct wi_softc *sc)
#if NBPFILTER > 0
/* Handle BPF listeners. */
if (ifp->if_bpf)
- BPF_MTAP(ifp, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
/* Receive packet unless in procframe or monitor mode. */
@@ -2358,7 +2357,7 @@ nextpkt:
* this frame to him.
*/
if (ifp->if_bpf)
- BPF_MTAP(ifp, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
m_freem(m0);
diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c
index 23c4d18d8d1..38acec88274 100644
--- a/sys/dev/ic/lemac.c
+++ b/sys/dev/ic/lemac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lemac.c,v 1.8 2005/11/14 14:46:41 mickey Exp $ */
+/* $OpenBSD: lemac.c,v 1.9 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: lemac.c,v 1.20 2001/06/13 10:46:02 wiz Exp $ */
/*-
@@ -310,7 +310,7 @@ lemac_input(struct lemac_softc *sc, bus_size_t offset, size_t length)
#if NBPFILTER > 0
if (sc->sc_if.if_bpf != NULL) {
m->m_pkthdr.len = m->m_len = length;
- bpf_mtap(sc->sc_if.if_bpf, m);
+ bpf_mtap(sc->sc_if.if_bpf, m, BPF_DIRECTION_IN);
}
/*
@@ -769,7 +769,7 @@ lemac_ifstart(struct ifnet *ifp)
LEMAC_OUTB(sc, LEMAC_REG_TQ, tx_pg);
#if NBPFILTER > 0
if (sc->sc_if.if_bpf != NULL)
- bpf_mtap(sc->sc_if.if_bpf, m);
+ bpf_mtap(sc->sc_if.if_bpf, m, BPF_DIRECTION_OUT);
#endif
m_freem(m); /* free the mbuf */
}
diff --git a/sys/dev/ic/midway.c b/sys/dev/ic/midway.c
index 473b658fa48..1bcaef7a029 100644
--- a/sys/dev/ic/midway.c
+++ b/sys/dev/ic/midway.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midway.c,v 1.36 2006/03/15 20:04:37 miod Exp $ */
+/* $OpenBSD: midway.c,v 1.37 2006/03/25 22:41:43 djm Exp $ */
/* (sync'd to midway.c 1.68) */
/*
@@ -177,8 +177,6 @@
#endif /* __FreeBSD__ */
-#define BPF_MTAP(ifp, m) bpf_mtap((ifp)->if_bpf, (m))
-
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
@@ -1940,7 +1938,7 @@ again:
launch.t->m_data += size;
launch.t->m_len -= size;
- BPF_MTAP(&sc->enif, launch.t);
+ bpf_mtap(sc->enif.if_bpf, launch.t, BPF_DIRECTION_OUT);
launch.t->m_data -= size;
launch.t->m_len += size;
@@ -2513,7 +2511,7 @@ void *arg;
#if NBPFILTER > 0
if (sc->enif.if_bpf)
- BPF_MTAP(&sc->enif, m);
+ bpf_mtap(sc->enif.if_bpf, m, BPF_DIRECTION_IN);
#endif
atm_input(&sc->enif, &ah, m, sc->rxslot[slot].rxhand);
diff --git a/sys/dev/ic/mtd8xx.c b/sys/dev/ic/mtd8xx.c
index 02eadfc0dd8..aca220b2d07 100644
--- a/sys/dev/ic/mtd8xx.c
+++ b/sys/dev/ic/mtd8xx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtd8xx.c,v 1.11 2005/11/19 01:59:37 aaron Exp $ */
+/* $OpenBSD: mtd8xx.c,v 1.12 2006/03/25 22:41:43 djm Exp $ */
/*
* Copyright (c) 2003 Oleg Safiullin <form@pdp11.org.ru>
@@ -745,7 +745,7 @@ mtd_start(struct ifnet *ifp)
*/
#if NBPFILTER > 0
if (ifp->if_bpf != NULL)
- bpf_mtap(ifp->if_bpf, m_head);
+ bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT);
#endif
}
@@ -965,7 +965,7 @@ mtd_rxeof(struct mtd_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);
}
diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c
index cb48c8bb3ce..9d499b2543b 100644
--- a/sys/dev/ic/pdq_ifsubr.c
+++ b/sys/dev/ic/pdq_ifsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdq_ifsubr.c,v 1.17 2005/11/09 05:50:25 brad Exp $ */
+/* $OpenBSD: pdq_ifsubr.c,v 1.18 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: pdq_ifsubr.c,v 1.5 1996/05/20 00:26:21 thorpej Exp $ */
/*-
@@ -187,7 +187,7 @@ pdq_os_receive_pdu(
sc->sc_if.if_ipackets++;
#if NBPFILTER > 0
if (sc->sc_bpf != NULL)
- PDQ_BPF_MTAP(sc, m);
+ PDQ_BPF_MTAP(sc, m, BPF_DIRECTION_IN);
if ((fh->fddi_fc & (FDDIFC_L|FDDIFC_F)) != FDDIFC_LLC_ASYNC) {
m_freem(m);
return;
@@ -223,7 +223,7 @@ pdq_os_transmit_done(
pdq_softc_t *sc = (pdq_softc_t *) pdq->pdq_os_ctx;
#if NBPFILTER > 0
if (sc->sc_bpf != NULL)
- PDQ_BPF_MTAP(sc, m);
+ PDQ_BPF_MTAP(sc, m, BPF_DIRECTION_OUT);
#endif
m_freem(m);
sc->sc_if.if_opackets++;
diff --git a/sys/dev/ic/pdqvar.h b/sys/dev/ic/pdqvar.h
index d4e1644cf96..34b7d585096 100644
--- a/sys/dev/ic/pdqvar.h
+++ b/sys/dev/ic/pdqvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdqvar.h,v 1.17 2005/11/23 11:30:14 mickey Exp $ */
+/* $OpenBSD: pdqvar.h,v 1.18 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: pdqvar.h,v 1.11 1996/10/25 21:33:37 cgd Exp $ */
/*-
@@ -110,8 +110,8 @@ typedef u_int16_t pdq_bus_ioport_t;
typedef volatile pdq_uint32_t *pdq_bus_memaddr_t;
typedef pdq_bus_memaddr_t pdq_bus_memoffset_t;
#if BSD >= 199506 /* __FreeBSD__ */
-#define PDQ_BPF_MTAP(sc, m) bpf_mtap(&(sc)->sc_if, m)
-#define PDQ_BPFATTACH(sc, t, s) bpfattach(&(sc)->sc_if, t, s)
+#define PDQ_BPF_MTAP(sc, m, dir) bpf_mtap(&(sc)->sc_if, m, dir)
+#define PDQ_BPFATTACH(sc, t, s) bpfattach(&(sc)->sc_if, t, s)
#endif
@@ -155,11 +155,11 @@ typedef pdq_uint32_t pdq_bus_memoffset_t;
#endif
#if !defined(PDQ_BPF_MTAP)
-#define PDQ_BPF_MTAP(sc, m) bpf_mtap((sc)->sc_bpf, m)
+#define PDQ_BPF_MTAP(sc, m, dir) bpf_mtap((sc)->sc_bpf, m, dir)
#endif
#if !defined(PDQ_BPFATTACH)
-#define PDQ_BPFATTACH(sc, t, s) bpfattach(&(sc)->sc_bpf, &(sc)->sc_if, t, s)
+#define PDQ_BPFATTACH(sc, t, s)bpfattach(&(sc)->sc_bpf, &(sc)->sc_if, t, s)
#endif
#if !defined(PDQ_OS_PTR_FMT)
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index 6d7a02afc88..777c5b61f51 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.18 2006/03/04 03:47:08 brad Exp $ */
+/* $OpenBSD: re.c,v 1.19 2006/03/25 22:41:43 djm Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1201,7 +1201,7 @@ re_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
ether_input_mbuf(ifp, m);
}
@@ -1510,7 +1510,7 @@ re_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
queued++;
}
diff --git a/sys/dev/ic/rln.c b/sys/dev/ic/rln.c
index 1ce30d87060..5f0820abff2 100644
--- a/sys/dev/ic/rln.c
+++ b/sys/dev/ic/rln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rln.c,v 1.17 2005/11/07 03:20:00 brad Exp $ */
+/* $OpenBSD: rln.c,v 1.18 2006/03/25 22:41:43 djm Exp $ */
/*
* David Leonard <d@openbsd.org>, 1999. Public Domain.
*
@@ -249,7 +249,7 @@ rlnstart(ifp)
#if NBPFILTER > 0
/* Tap packet stream here for BPF listeners. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
/* We need to use m->m_pkthdr.len, so require the header. */
@@ -587,7 +587,7 @@ rlnread(sc, hdr, len)
#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);
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)
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index c2e7792327f..34a8b21db1b 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.13 2006/02/25 13:08:39 damien Exp $ */
+/* $OpenBSD: rt2661.c,v 1.14 2006/03/25 22:41:43 djm Exp $ */
/*-
* Copyright (c) 2006
@@ -1251,7 +1251,7 @@ rt2661_rx_intr(struct rt2661_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
@@ -1597,7 +1597,7 @@ rt2661_tx_mgt(struct rt2661_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
@@ -1847,7 +1847,7 @@ rt2661_tx_data(struct rt2661_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
@@ -1918,7 +1918,8 @@ rt2661_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 (rt2661_tx_mgt(sc, m0, ni) != 0)
break;
@@ -1937,14 +1938,15 @@ rt2661_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 (rt2661_tx_data(sc, m0, ni, 0) != 0) {
if (ni != NULL)
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index 18bbaf88f1f..b1bfcfe4e62 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.47 2005/11/07 03:20:00 brad Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.48 2006/03/25 22:41:43 djm Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -718,7 +718,7 @@ rl_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
ether_input_mbuf(ifp, m);
@@ -926,7 +926,8 @@ void rl_start(ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, RL_CUR_TXMBUF(sc));
+ bpf_mtap(ifp->if_bpf, RL_CUR_TXMBUF(sc),
+ BPF_DIRECTION_OUT);
#endif
/*
* Transmit the frame.
diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c
index 785187fd13e..5e91dfa13ce 100644
--- a/sys/dev/ic/rtw.c
+++ b/sys/dev/ic/rtw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtw.c,v 1.53 2006/02/05 23:47:47 jsg Exp $ */
+/* $OpenBSD: rtw.c,v 1.54 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */
/*-
@@ -1334,7 +1334,7 @@ rtw_intr_rx(struct rtw_softc *sc, u_int16_t isr)
mb.m_len = sizeof(sc->sc_rxtapu);
mb.m_next = m;
mb.m_pkthdr.len += mb.m_len;
- bpf_mtap(sc->sc_radiobpf, &mb);
+ bpf_mtap(sc->sc_radiobpf, &mb, BPF_DIRECTION_IN);
}
#endif /* NPBFILTER > 0 */
@@ -2826,7 +2826,7 @@ rtw_dequeue(struct ifnet *ifp, struct rtw_txsoft_blk **tsbp,
ifp->if_opackets++;
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
if ((m0 = ieee80211_encap(ifp, m0, nip)) == NULL) {
DPRINTF(sc, RTW_DEBUG_XMIT,
@@ -3065,7 +3065,8 @@ rtw_start(struct ifnet *ifp)
#if NBPFILTER > 0
if (ic->ic_rawbpf != NULL)
- bpf_mtap((caddr_t)ic->ic_rawbpf, m0);
+ bpf_mtap((caddr_t)ic->ic_rawbpf, m0,
+ BPF_DIRECTION_OUT);
if (sc->sc_radiobpf != NULL) {
struct mbuf mb;
@@ -3083,7 +3084,7 @@ rtw_start(struct ifnet *ifp)
mb.m_len = sizeof(sc->sc_txtapu);
mb.m_next = m0;
mb.m_pkthdr.len += mb.m_len;
- bpf_mtap(sc->sc_radiobpf, &mb);
+ bpf_mtap(sc->sc_radiobpf, &mb, BPF_DIRECTION_OUT);
}
#endif /* NPBFILTER > 0 */
diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c
index 975f982631f..c03e6af3d46 100644
--- a/sys/dev/ic/smc83c170.c
+++ b/sys/dev/ic/smc83c170.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smc83c170.c,v 1.7 2005/12/15 23:40:19 krw Exp $ */
+/* $OpenBSD: smc83c170.c,v 1.8 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */
/*-
@@ -496,7 +496,7 @@ epic_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
}
@@ -775,7 +775,7 @@ epic_intr(void *arg)
* pass it up the stack if its for us.
*/
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/ic/smc90cx6.c b/sys/dev/ic/smc90cx6.c
index 327b5b79734..aeb365ad120 100644
--- a/sys/dev/ic/smc90cx6.c
+++ b/sys/dev/ic/smc90cx6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smc90cx6.c,v 1.11 2005/02/14 14:00:49 brad Exp $ */
+/* $OpenBSD: smc90cx6.c,v 1.12 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: smc90cx6.c,v 1.17 1996/05/07 01:43:18 thorpej Exp $ */
/*
@@ -574,7 +574,7 @@ bah_start(ifp)
* that RAM is just accessed as on every other byte)
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
#endif
#ifdef BAH_DEBUG
@@ -871,7 +871,7 @@ bah_srint(vsc, dummy)
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, head);
+ bpf_mtap(ifp->if_bpf, head, BPF_DIRECTION_IN);
#endif
arc_input(&sc->sc_arccom.ac_if, head);
diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c
index 0e050823229..75a428bae0e 100644
--- a/sys/dev/ic/smc91cxx.c
+++ b/sys/dev/ic/smc91cxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smc91cxx.c,v 1.23 2006/02/24 01:48:27 brad Exp $ */
+/* $OpenBSD: smc91cxx.c,v 1.24 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: smc91cxx.c,v 1.11 1998/08/08 23:51:41 mycroft Exp $ */
/*-
@@ -707,7 +707,7 @@ smc91cxx_start(ifp)
#if NBPFILTER > 0
/* Hand off a copy to the bpf. */
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, top);
+ bpf_mtap(ifp->if_bpf, top, BPF_DIRECTION_OUT);
#endif
ifp->if_opackets++;
@@ -1010,7 +1010,7 @@ smc91cxx_read(sc)
* we need to check if the packet is ours.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
#endif
m->m_pkthdr.len = m->m_len = packetlen;
diff --git a/sys/dev/ic/tropic.c b/sys/dev/ic/tropic.c
index ad3433d60c4..db6c8554fde 100644
--- a/sys/dev/ic/tropic.c
+++ b/sys/dev/ic/tropic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tropic.c,v 1.10 2005/11/07 03:20:00 brad Exp $ */
+/* $OpenBSD: tropic.c,v 1.11 2006/03/25 22:41:43 djm Exp $ */
/* $NetBSD: tropic.c,v 1.6 1999/12/17 08:26:31 fvdl Exp $ */
/*
@@ -737,7 +737,7 @@ next:
return;
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
first_txbuf = txbuf = TXCA_INW(sc, TXCA_FREE_QUEUE_HEAD) - XMIT_NEXTBUF;
framedata = txbuf + XMIT_FP_DATA;
@@ -1280,7 +1280,7 @@ struct tr_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
token_input(ifp, m);
}
@@ -1349,7 +1349,7 @@ struct tr_softc *sc;
if (m0 != 0) {
#if NBPFILTER > 0
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT);
#endif
/* Pull packet off interface send queue, fill DHB. */
trh = mtod(m0, struct token_header *);
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index fb2b44bd7d7..cf6223078dd 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.71 2006/03/04 23:31:20 brad Exp $ */
+/* $OpenBSD: xl.c,v 1.72 2006/03/25 22:41:43 djm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1305,7 +1305,7 @@ again:
* 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
@@ -1839,7 +1839,8 @@ xl_start(ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, cur_tx->xl_mbuf);
+ bpf_mtap(ifp->if_bpf, cur_tx->xl_mbuf,
+ BPF_DIRECTION_OUT);
#endif
}
@@ -1961,7 +1962,8 @@ xl_start_90xB(ifp)
* to him.
*/
if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, cur_tx->xl_mbuf);
+ bpf_mtap(ifp->if_bpf, cur_tx->xl_mbuf,
+ BPF_DIRECTION_OUT);
#endif
XL_INC(idx, XL_TX_LIST_CNT);