summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ath/if_ath.c2
-rw-r--r--sys/dev/awi/awi.c5
-rw-r--r--sys/dev/gem/if_gem.c3
-rw-r--r--sys/dev/ipw/if_ipw.c2
-rw-r--r--sys/dev/iwi/if_iwi.c2
-rw-r--r--sys/dev/lmc/if_lmc.h2
-rw-r--r--sys/dev/ral/rt2661.c4
-rw-r--r--sys/dev/usb/if_ural.c4
-rw-r--r--sys/net/if_faith.c2
-rw-r--r--sys/net/if_fwsubr.c4
-rw-r--r--sys/netgraph/ng_iface.c2
11 files changed, 15 insertions, 17 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 09d5976..aeee905 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -3635,7 +3635,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf
ieee80211_dump_pkt(mtod(m0, caddr_t), m0->m_len,
sc->sc_hwmap[txrate].ieeerate, -1);
- if (ic->ic_rawbpf)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
if (bpf_peers_present(sc->sc_drvbpf)) {
u_int64_t tsf = ath_hal_gettsf64(ah);
diff --git a/sys/dev/awi/awi.c b/sys/dev/awi/awi.c
index 6dd75bf..6b14f46 100644
--- a/sys/dev/awi/awi.c
+++ b/sys/dev/awi/awi.c
@@ -796,8 +796,7 @@ awi_start(struct ifnet *ifp)
}
IFQ_DEQUEUE(&ifp->if_snd, m0);
#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m0);
+ BPF_MTAP(ifp, m0);
#endif
if ((ifp->if_flags & IFF_LINK0) || sc->sc_adhoc_ap)
m0 = awi_ether_encap(sc, m0);
@@ -839,7 +838,7 @@ awi_start(struct ifnet *ifp)
ifp->if_opackets++;
}
#if NBPFILTER > 0
- if (ic->ic_rawbpf)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
#endif
if (dowep) {
diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c
index 4ffd71e..3efe0ed 100644
--- a/sys/dev/gem/if_gem.c
+++ b/sys/dev/gem/if_gem.c
@@ -1205,8 +1205,7 @@ gem_start_locked(ifp)
bus_space_write_4(sc->sc_bustag, sc->sc_h, GEM_TX_KICK,
sc->sc_txnext);
- if (ifp->if_bpf != NULL)
- bpf_mtap(ifp->if_bpf, m0);
+ BPF_MTAP(ifp, m0);
} while (1);
if (txmfail == -1 || sc->sc_txfree == 0) {
diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c
index c7da03e..bdde37c 100644
--- a/sys/dev/ipw/if_ipw.c
+++ b/sys/dev/ipw/if_ipw.c
@@ -1495,7 +1495,7 @@ ipw_start(struct ifnet *ifp)
continue;
}
- if (ic->ic_rawbpf != NULL)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
if (ipw_tx_start(ifp, m0, ni) != 0) {
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index 3079fb4..5ede5a8 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -1984,7 +1984,7 @@ iwi_start(struct ifnet *ifp)
continue;
}
- if (ic->ic_rawbpf != NULL)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
if (iwi_tx_start(ifp, m0, ni, ac) != 0) {
diff --git a/sys/dev/lmc/if_lmc.h b/sys/dev/lmc/if_lmc.h
index 734b768..af901f7 100644
--- a/sys/dev/lmc/if_lmc.h
+++ b/sys/dev/lmc/if_lmc.h
@@ -1242,7 +1242,7 @@ struct softc
# define DMA_LOAD(map, addr, size) bus_dmamap_load(ring->tag, map, addr, size, fbsd_dmamap_load, ring, 0)
# if (NBPFILTER != 0)
# if (__FreeBSD_version >= 500000)
-# define LMC_BPF_MTAP(mbuf) if (sc->ifp->if_bpf) bpf_mtap(sc->ifp->if_bpf, mbuf)
+# define LMC_BPF_MTAP(mbuf) BPF_MTAP(sc->ifp, mbuf)
# else /* FreeBSD-4 */
# define LMC_BPF_MTAP(mbuf) if (sc->ifp->if_bpf) bpf_mtap(sc->ifp, mbuf)
# endif
diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c
index d40e906..408a6f2 100644
--- a/sys/dev/ral/rt2661.c
+++ b/sys/dev/ral/rt2661.c
@@ -1782,7 +1782,7 @@ rt2661_start(struct ifnet *ifp)
ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
m0->m_pkthdr.rcvif = NULL;
- if (ic->ic_rawbpf != NULL)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
if (rt2661_tx_mgt(sc, m0, ni) != 0)
@@ -1836,7 +1836,7 @@ rt2661_start(struct ifnet *ifp)
continue;
}
- if (ic->ic_rawbpf != NULL)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
if (rt2661_tx_data(sc, m0, ni, ac) != 0) {
diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c
index 5a92e2c..1a4bdec 100644
--- a/sys/dev/usb/if_ural.c
+++ b/sys/dev/usb/if_ural.c
@@ -1355,7 +1355,7 @@ ural_start(struct ifnet *ifp)
ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
m0->m_pkthdr.rcvif = NULL;
- if (ic->ic_rawbpf != NULL)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
if (ural_tx_mgt(sc, m0, ni) != 0)
@@ -1391,7 +1391,7 @@ ural_start(struct ifnet *ifp)
continue;
}
- if (ic->ic_rawbpf != NULL)
+ if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, m0);
if (ural_tx_data(sc, m0, ni) != 0) {
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index 71b8c35..6e3f446 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -204,7 +204,7 @@ faithoutput(ifp, m, dst, rt)
dst->sa_family = af;
}
- if (ifp->if_bpf) {
+ if (bpf_peers_present(ifp->if_bpf)) {
af = dst->sa_family;
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
}
diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c
index 7cf1c22..774e206 100644
--- a/sys/net/if_fwsubr.c
+++ b/sys/net/if_fwsubr.c
@@ -190,7 +190,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
/*
* Let BPF tap off a copy before we encapsulate.
*/
- if (ifp->if_bpf) {
+ if (bpf_peers_present(ifp->if_bpf)) {
struct fw_bpfhdr h;
if (unicast)
bcopy(destfw, h.firewire_dhost, 8);
@@ -565,7 +565,7 @@ firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src)
* Give bpf a chance at the packet. The link-level driver
* should have left us a tag with the EUID of the sender.
*/
- if (ifp->if_bpf) {
+ if (bpf_peers_present(ifp->if_bpf)) {
struct fw_bpfhdr h;
struct m_tag *mtag;
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c
index 0cb2326..b3c177a 100644
--- a/sys/netgraph/ng_iface.c
+++ b/sys/netgraph/ng_iface.c
@@ -418,7 +418,7 @@ static void
ng_iface_bpftap(struct ifnet *ifp, struct mbuf *m, sa_family_t family)
{
KASSERT(family != AF_UNSPEC, ("%s: family=AF_UNSPEC", __func__));
- if (ifp->if_bpf != NULL) {
+ if (bpf_peers_present(ifp->if_bpf)) {
int32_t family4 = (int32_t)family;
bpf_mtap2(ifp->if_bpf, &family4, sizeof(family4), m);
}
OpenPOWER on IntegriCloud