Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Sep 2014 19:05:23 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272266 - in head/sys/dev: ce cp ctau cx ie
Message-ID:  <201409281905.s8SJ5NPg006227@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: melifaro
Date: Sun Sep 28 19:05:22 2014
New Revision: 272266
URL: http://svnweb.freebsd.org/changeset/base/272266

Log:
  Convert most BPF_TAP users to BPF_MTAP.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/ce/if_ce.c
  head/sys/dev/cp/if_cp.c
  head/sys/dev/ctau/if_ct.c
  head/sys/dev/cx/if_cx.c
  head/sys/dev/ie/if_ie.c

Modified: head/sys/dev/ce/if_ce.c
==============================================================================
--- head/sys/dev/ce/if_ce.c	Sun Sep 28 18:34:20 2014	(r272265)
+++ head/sys/dev/ce/if_ce.c	Sun Sep 28 19:05:22 2014	(r272266)
@@ -1133,12 +1133,7 @@ static void ce_receive (ce_chan_t *c, un
 	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
 }

Modified: head/sys/dev/cp/if_cp.c
==============================================================================
--- head/sys/dev/cp/if_cp.c	Sun Sep 28 18:34:20 2014	(r272265)
+++ head/sys/dev/cp/if_cp.c	Sun Sep 28 19:05:22 2014	(r272266)
@@ -902,7 +902,7 @@ static void cp_receive (cp_chan_t *c, un
 	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
 }

Modified: head/sys/dev/ctau/if_ct.c
==============================================================================
--- head/sys/dev/ctau/if_ct.c	Sun Sep 28 18:34:20 2014	(r272265)
+++ head/sys/dev/ctau/if_ct.c	Sun Sep 28 19:05:22 2014	(r272266)
@@ -1120,7 +1120,7 @@ static void ct_receive (ct_chan_t *c, ch
 	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
 }

Modified: head/sys/dev/cx/if_cx.c
==============================================================================
--- head/sys/dev/cx/if_cx.c	Sun Sep 28 18:34:20 2014	(r272265)
+++ head/sys/dev/cx/if_cx.c	Sun Sep 28 19:05:22 2014	(r272266)
@@ -1318,7 +1318,7 @@ static void cx_receive (cx_chan_t *c, ch
 	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
 }

Modified: head/sys/dev/ie/if_ie.c
==============================================================================
--- head/sys/dev/ie/if_ie.c	Sun Sep 28 18:34:20 2014	(r272265)
+++ head/sys/dev/ie/if_ie.c	Sun Sep 28 19:05:22 2014	(r272266)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409281905.s8SJ5NPg006227>