Author: vmaffione
Date: Thu Dec  6 09:45:25 2018
New Revision: 341624
URL: https://svnweb.freebsd.org/changeset/base/341624

Log:
  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 <mdelagueronni...@verisign.com>
  Reviewed by:  vmaffione
  MFC after:    1 week
  Sponsored by: Verisign, Inc.
  Differential Revision:        https://reviews.freebsd.org/D17896

Modified:
  head/sys/dev/netmap/netmap.c

Modified: head/sys/dev/netmap/netmap.c
==============================================================================
--- head/sys/dev/netmap/netmap.c        Thu Dec  6 09:22:35 2018        
(r341623)
+++ head/sys/dev/netmap/netmap.c        Thu Dec  6 09:45:25 2018        
(r341624)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to