Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Dec 2018 09:39:05 +0000 (UTC)
From:      Vincenzo Maffione <vmaffione@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r342031 - stable/12/sys/dev/netmap
Message-ID:  <201812130939.wBD9d5oA072134@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vmaffione
Date: Thu Dec 13 09:39:05 2018
New Revision: 342031
URL: https://svnweb.freebsd.org/changeset/base/342031

Log:
  MFC r341624
  
  netmap: netmap_transmit should honor bpf packet tap hook
  
  This allows tcpdump to capture outbound kernel packets while
  in netmap mode
  
  Submitted by:   Marc de la Gueronniere <mdelagueronniere@verisign.com>
  Reviewed by:    vmaffione
  MFC after:      1 week
  Sponsored by:   Verisign, Inc.
  Differential Revision:  https://reviews.freebsd.org/D17896

Modified:
  stable/12/sys/dev/netmap/netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/netmap/netmap.c
==============================================================================
--- stable/12/sys/dev/netmap/netmap.c	Thu Dec 13 08:59:51 2018	(r342030)
+++ stable/12/sys/dev/netmap/netmap.c	Thu Dec 13 09:39:05 2018	(r342031)
@@ -449,6 +449,7 @@ ports attached to the switch)
 #include <machine/bus.h>	/* bus_dmamap_* */
 #include <sys/endian.h>
 #include <sys/refcount.h>
+#include <net/ethernet.h>      /* ETHER_BPF_MTAP */
 
 
 #elif defined(linux)
@@ -3859,6 +3860,10 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m)
 		RD(1, "%s drop mbuf that needs generic segmentation offload", na->name);
 		goto done;
 	}
+
+#ifdef __FreeBSD__
+	ETHER_BPF_MTAP(ifp, m);
+#endif /* __FreeBSD__ */
 
 	/* protect against netmap_rxsync_from_host(), netmap_sw_to_nic()
 	 * and maybe other instances of netmap_transmit (the latter



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