svn commit: r342034 - stable/11/sys/dev/netmap
Vincenzo Maffione
vmaffione at FreeBSD.org
Thu Dec 13 10:17:33 UTC 2018
Author: vmaffione
Date: Thu Dec 13 10:17:32 2018
New Revision: 342034
URL: https://svnweb.freebsd.org/changeset/base/342034
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 at verisign.com>
Reviewed by: vmaffione
MFC after: 1 week
Sponsored by: Verisign, Inc.
Differential Revision: https://reviews.freebsd.org/D17896
Modified:
stable/11/sys/dev/netmap/netmap.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/netmap/netmap.c
==============================================================================
--- stable/11/sys/dev/netmap/netmap.c Thu Dec 13 10:13:29 2018 (r342033)
+++ stable/11/sys/dev/netmap/netmap.c Thu Dec 13 10:17:32 2018 (r342034)
@@ -447,6 +447,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)
@@ -3860,6 +3861,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
More information about the svn-src-all
mailing list