Convert most BPF_TAP users to BPF_MTAP.

MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2014-09-28 19:05:22 +00:00
parent 03f90784bf
commit c6682d5906
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272266
5 changed files with 6 additions and 16 deletions

View File

@ -1133,12 +1133,7 @@ static void ce_receive (ce_chan_t *c, unsigned char *data, int len)
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 __FreeBSD_version >= 500000
BPF_TAP (d->ifp, data, len);
#else
if (d->ifp->if_bpf)
bpf_tap (d->ifp, data, len);
#endif
BPF_MTAP(d->ifp, m);
IF_ENQUEUE(&d->rqueue, m);
#endif
}

View File

@ -902,7 +902,7 @@ static void cp_receive (cp_chan_t *c, unsigned char *data, int len)
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. */
BPF_TAP (d->ifp, data, len);
BPF_MTAP(d->ifp, m);
IF_ENQUEUE (&d->queue, m);
#endif
}

View File

@ -1120,7 +1120,7 @@ static void ct_receive (ct_chan_t *c, char *data, int len)
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. */
BPF_TAP (d->ifp, data, len);
BPF_MTAP(d->ifp, m);
IF_ENQUEUE (&d->queue, m);
#endif
}

View File

@ -1318,7 +1318,7 @@ static void cx_receive (cx_chan_t *c, char *data, int len)
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. */
BPF_TAP (d->ifp, data, len);
BPF_MTAP(d->ifp, m);
IF_ENQUEUE (&d->queue, m);
#endif
}

View File

@ -949,6 +949,8 @@ iestart_locked(struct ifnet *ifp)
if (!m)
break;
BPF_MTAP(ifp, m);
buffer = sc->xmit_cbuffs[sc->xmit_count];
len = 0;
@ -961,13 +963,6 @@ iestart_locked(struct ifnet *ifp)
m_freem(m0);
len = max(len, ETHER_MIN_LEN);
/*
* See if bpf is listening on this interface, let it see the
* packet before we commit it to the wire.
*/
BPF_TAP(sc->ifp,
(void *)sc->xmit_cbuffs[sc->xmit_count], len);
sc->xmit_buffs[sc->xmit_count]->ie_xmit_flags =
IE_XMIT_LAST|len;
sc->xmit_buffs[sc->xmit_count]->ie_xmit_next = 0xffff;