From ff046a6c6b6c35524b26b1f40f8f51c63a68c9c4 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 2 Jun 2006 23:14:40 +0000 Subject: [PATCH] add missed calls to bpf_peers_present --- sys/dev/ath/if_ath.c | 2 +- sys/dev/awi/awi.c | 5 ++--- sys/dev/gem/if_gem.c | 3 +-- sys/dev/ipw/if_ipw.c | 2 +- sys/dev/iwi/if_iwi.c | 2 +- sys/dev/lmc/if_lmc.h | 2 +- sys/dev/ral/rt2661.c | 4 ++-- sys/dev/usb/if_ural.c | 4 ++-- sys/net/if_faith.c | 2 +- sys/net/if_fwsubr.c | 4 ++-- sys/netgraph/ng_iface.c | 2 +- 11 files changed, 15 insertions(+), 17 deletions(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 09d59763ae7..aeee9059c30 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 6dd75bf3468..6b14f46bb11 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 4ffd71eec3b..3efe0ed711a 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 c7da03e51e8..bdde37c608f 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 3079fb4b29e..5ede5a80b26 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 734b768c02f..af901f7a612 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 d40e9062cee..408a6f29038 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 5a92e2c7114..1a4bdecf8f0 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 71b8c357359..6e3f44672e1 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 7cf1c220782..774e206bfcc 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 0cb2326be47..b3c177a2358 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); }