aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/netmap
diff options
context:
space:
mode:
authorVincenzo Maffione <vmaffione@FreeBSD.org>2018-12-06 09:45:25 +0000
committerVincenzo Maffione <vmaffione@FreeBSD.org>2018-12-06 09:45:25 +0000
commit89a9a5b5c9ce129e2e9e9ee40bd01a8ed50538f4 (patch)
tree439deb598baa4044a47c70befc41d55ea18c6c75 /sys/dev/netmap
parent037479ff5ee18977b1c48e1e59770aad2f200a5a (diff)
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
Notes
svn path=/head/; revision=341624
Diffstat (limited to 'sys/dev/netmap')
-rw-r--r--sys/dev/netmap/netmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
index 49047510f342..dfd4dacc4962 100644
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -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)
@@ -3860,6 +3861,10 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m)
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
* not possible on Linux).