Index: contrib/pf/net/if_pfsync.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/contrib/pf/net/if_pfsync.c,v retrieving revision 1.31 diff -u -r1.31 if_pfsync.c --- contrib/pf/net/if_pfsync.c 6 Nov 2006 13:41:50 -0000 1.31 +++ contrib/pf/net/if_pfsync.c 29 Dec 2006 04:03:32 -0000 @@ -1793,9 +1793,13 @@ KASSERT(m != NULL, ("pfsync_sendout: null mbuf")); #endif #if NBPFILTER > 0 +#ifdef __FreeBSD__ + BPF_MTAP(ifp, m); +#else if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); #endif +#endif if (sc->sc_mbuf_net) { m_freem(m); Index: dev/arl/if_arl.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/arl/if_arl.c,v retrieving revision 1.14 diff -u -r1.14 if_arl.c --- dev/arl/if_arl.c 6 Nov 2006 13:41:51 -0000 1.14 +++ dev/arl/if_arl.c 29 Dec 2006 04:05:53 -0000 @@ -980,7 +980,7 @@ * Check if there's a bpf filter listening on this interface. * If so, hand off the raw packet to bpf. */ - if (ifp->if_bpf) { + if (bpf_peers_present(ifp->if_bpf)) { /* * Note that the interface cannot be in promiscuous mode if * there are no bpf listeners. And if el are in promiscuous Index: dev/ce/if_ce.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/ce/if_ce.c,v retrieving revision 1.4 diff -u -r1.4 if_ce.c --- dev/ce/if_ce.c 6 Nov 2006 13:41:51 -0000 1.4 +++ dev/ce/if_ce.c 29 Dec 2006 04:15:23 -0000 @@ -1070,10 +1070,10 @@ if (! m) return; #ifndef NETGRAPH - if (d->ifp->if_bpf) #if __FreeBSD_version >= 500000 - BPF_MTAP (d->ifp, m); + BPF_MTAP (d->ifp, m); #else + if (d->ifp->if_bpf) bpf_mtap (d->ifp, m); #endif #endif @@ -1192,10 +1192,10 @@ m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ - if (d->ifp->if_bpf) #if __FreeBSD_version >= 500000 - BPF_TAP (d->ifp, data, len); + BPF_TAP (d->ifp, data, len); #else + if (d->ifp->if_bpf) bpf_tap (d->ifp, data, len); #endif IF_ENQUEUE(&d->rqueue, m); Index: dev/cp/if_cp.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/cp/if_cp.c,v retrieving revision 1.30 diff -u -r1.30 if_cp.c --- dev/cp/if_cp.c 6 Nov 2006 13:41:52 -0000 1.30 +++ dev/cp/if_cp.c 29 Dec 2006 04:08:07 -0000 @@ -833,8 +833,7 @@ if (! m) return; #ifndef NETGRAPH - if (d->ifp->if_bpf) - BPF_MTAP (d->ifp, m); + BPF_MTAP (d->ifp, m); #endif len = m_length (m, NULL); if (len >= BUFSZ) @@ -943,8 +942,7 @@ m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ - if (d->ifp->if_bpf) - BPF_TAP (d->ifp, data, len); + BPF_TAP (d->ifp, data, len); IF_ENQUEUE (&d->queue, m); #endif } Index: dev/ctau/if_ct.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/ctau/if_ct.c,v retrieving revision 1.30 diff -u -r1.30 if_ct.c --- dev/ctau/if_ct.c 6 Nov 2006 13:41:52 -0000 1.30 +++ dev/ctau/if_ct.c 29 Dec 2006 04:08:51 -0000 @@ -1040,8 +1040,7 @@ if (! m) return; #ifndef NETGRAPH - if (d->ifp->if_bpf) - BPF_MTAP (d->ifp, m); + BPF_MTAP (d->ifp, m); #endif len = m_length (m, NULL); if (! m->m_next) @@ -1161,8 +1160,7 @@ m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ - if (d->ifp->if_bpf) - BPF_TAP (d->ifp, data, len); + BPF_TAP (d->ifp, data, len); IF_ENQUEUE (&d->queue, m); #endif } Index: dev/cx/if_cx.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/cx/if_cx.c,v retrieving revision 1.53 diff -u -r1.53 if_cx.c --- dev/cx/if_cx.c 6 Nov 2006 13:41:52 -0000 1.53 +++ dev/cx/if_cx.c 29 Dec 2006 04:08:28 -0000 @@ -1195,8 +1195,7 @@ if (! m) return; #ifndef NETGRAPH - if (d->ifp->if_bpf) - BPF_MTAP (d->ifp, m); + BPF_MTAP (d->ifp, m); #endif len = m_length (m, NULL); if (! m->m_next) @@ -1352,8 +1351,7 @@ m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ - if (d->ifp->if_bpf) - BPF_TAP (d->ifp, data, len); + BPF_TAP (d->ifp, data, len); IF_ENQUEUE (&d->queue, m); #endif } Index: dev/en/midway.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/en/midway.c,v retrieving revision 1.69 diff -u -r1.69 midway.c --- dev/en/midway.c 15 Sep 2006 15:16:11 -0000 1.69 +++ dev/en/midway.c 29 Dec 2006 03:53:04 -0000 @@ -776,7 +776,7 @@ sc->vccs[tx.vci]->obytes += tx.datalen; #ifdef ENABLE_BPF - if (sc->ifp->if_bpf != NULL) { + if (bpf_peers_present(sc->ifp->if_bpf)) { /* * adjust the top of the mbuf to skip the TBD if present * before passing the packet to bpf. @@ -794,7 +794,7 @@ tx.m->m_pkthdr.len = tx.datalen; } - BPF_MTAP(sc->ifp, tx.m); + bpf_mtap(sc->ifp, tx.m); } #endif Index: dev/firewire/if_fwip.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/firewire/if_fwip.c,v retrieving revision 1.11 diff -u -r1.11 if_fwip.c --- dev/firewire/if_fwip.c 5 Oct 2005 10:09:14 -0000 1.11 +++ dev/firewire/if_fwip.c 29 Dec 2006 04:09:51 -0000 @@ -838,7 +838,7 @@ * Record the sender ID for possible BPF usage. */ src = ntohl(p[1]) >> 16; - if (ifp->if_bpf) { + if (bpf_peers_present(ifp->if_bpf)) { mtag = m_tag_alloc(MTAG_FIREWIRE, MTAG_FIREWIRE_SENDER_EUID, 2*sizeof(uint32_t), M_NOWAIT); @@ -939,7 +939,7 @@ return; } - if (ifp->if_bpf) { + if (bpf_peers_present(ifp->if_bpf)) { /* * Record the sender ID for possible BPF usage. */ Index: dev/my/if_my.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/my/if_my.c,v retrieving revision 1.39 diff -u -r1.39 if_my.c --- dev/my/if_my.c 15 Sep 2006 15:16:12 -0000 1.39 +++ dev/my/if_my.c 29 Dec 2006 04:11:59 -0000 @@ -1161,8 +1161,8 @@ * broadcast packet, multicast packet, matches our ethernet * address or the interface is in promiscuous mode. */ - if (ifp->if_bpf) { - BPF_MTAP(ifp, m); + if (bpf_peers_present(ifp->if_bpf)) { + bpf_mtap(ifp, m); if (ifp->if_flags & IFF_PROMISC && (bcmp(eh->ether_dhost, IF_LLADDR(sc->my_ifp), ETHER_ADDR_LEN) && Index: dev/ppbus/if_plip.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/dev/ppbus/if_plip.c,v retrieving revision 1.41 diff -u -r1.41 if_plip.c --- dev/ppbus/if_plip.c 22 Feb 2006 18:16:25 -0000 1.41 +++ dev/ppbus/if_plip.c 29 Dec 2006 04:13:08 -0000 @@ -514,7 +514,7 @@ sc->sc_ifp->if_ibytes += len; top = m_devget(sc->sc_ifbuf + CLPIPHDRLEN, len, 0, sc->sc_ifp, 0); if (top) { - if (sc->sc_ifp->if_bpf) + if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */ } @@ -559,7 +559,7 @@ sc->sc_ifp->if_ibytes += len; top = m_devget(sc->sc_ifbuf + LPIPHDRLEN, len, 0, sc->sc_ifp, 0); if (top) { - if (sc->sc_ifp->if_bpf) + if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */ } @@ -694,7 +694,7 @@ } else { ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; - if (ifp->if_bpf) + if (bpf_peers_present(ifp->if_bpf)) lptap(ifp, m); } @@ -739,7 +739,7 @@ } else { ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; - if (ifp->if_bpf) + if (bpf_peers_present(ifp->if_bpf)) lptap(ifp, m); } Index: i4b/driver/i4b_ipr.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/i4b/driver/i4b_ipr.c,v retrieving revision 1.36 diff -u -r1.36 i4b_ipr.c --- i4b/driver/i4b_ipr.c 6 Nov 2006 13:41:59 -0000 1.36 +++ i4b/driver/i4b_ipr.c 29 Dec 2006 04:16:19 -0000 @@ -883,7 +883,7 @@ } #endif - if(sc->sc_ifp->if_bpf) + if(bpf_peers_present(sc->sc_ifp->if_bpf)) { /* prepend the address family as a four byte field */ struct mbuf mm; @@ -891,7 +891,7 @@ mm.m_next = m; mm.m_len = 4; mm.m_data = (char *)⁡ - BPF_MTAP(sc->sc_ifp, &mm); + bpf_mtap(sc->sc_ifp, &mm); } if(netisr_queue(NETISR_IP, m)) /* (0) on success. */ @@ -936,7 +936,7 @@ microtime(&sc->sc_ifp->if_lastchange); - if(sc->sc_ifp->if_bpf) + if(bpf_peers_present(sc->sc_ifp->if_bpf)) { /* prepend the address family as a four byte field */ @@ -945,7 +945,7 @@ mm.m_next = m; mm.m_len = 4; mm.m_data = (char *)⁡ - BPF_MTAP(sc->sc_ifp, &mm); + bpf_mtap(sc->sc_ifp, &mm); } #if I4BIPRACCT Index: net/if_enc.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/net/if_enc.c,v retrieving revision 1.5 diff -u -r1.5 if_enc.c --- net/if_enc.c 10 Jul 2006 05:24:06 -0000 1.5 +++ net/if_enc.c 29 Dec 2006 04:17:19 -0000 @@ -280,7 +280,7 @@ if ((encif->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - if (encif->if_bpf) { + if (bpf_peers_present(encif->if_bpf)) { flags = 0; if (sav->alg_enc != SADB_EALG_NONE) flags |= M_CONF; Index: netgraph/ng_sppp.c =================================================================== RCS file: /host/cvs/usr/cvs/src/sys/netgraph/ng_sppp.c,v retrieving revision 1.10 diff -u -r1.10 ng_sppp.c --- netgraph/ng_sppp.c 29 Jan 2006 22:06:51 -0000 1.10 +++ netgraph/ng_sppp.c 29 Dec 2006 04:17:50 -0000 @@ -219,8 +219,7 @@ ifp->if_drv_flags |= IFF_DRV_OACTIVE; while ((m = sppp_dequeue (ifp)) != NULL) { - if (ifp->if_bpf) - BPF_MTAP (ifp, m); + BPF_MTAP (ifp, m); len = m->m_pkthdr.len; NG_SEND_DATA_ONLY (error, priv->hook, m); @@ -382,8 +381,7 @@ m->m_pkthdr.rcvif = SP2IFP(pp); /* Berkeley packet filter */ - if (SP2IFP(pp)->if_bpf) - BPF_MTAP (SP2IFP(pp), m); + BPF_MTAP (SP2IFP(pp), m); /* Send packet */ sppp_input (SP2IFP(pp), m);