Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Implement the BPF direction filter (BIOC[GS]DIRECTION). It p...



details:   https://anonhg.NetBSD.org/src/rev/52f0978340b3
branches:  trunk
changeset: 323694:52f0978340b3
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Jun 26 06:47:57 2018 +0000

description:
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.

diffstat:

 share/man/man4/bpf.4                     |  39 ++++++++++++---
 sys/arch/acorn32/podulebus/if_ie.c       |   6 +-
 sys/arch/amiga/dev/if_es.c               |   6 +-
 sys/arch/amiga/dev/if_qn.c               |   6 +-
 sys/arch/arm/at91/at91emac.c             |   8 +-
 sys/arch/arm/broadcom/bcm53xx_eth.c      |   4 +-
 sys/arch/arm/ep93xx/epe.c                |   6 +-
 sys/arch/arm/gemini/gemini_gmac.c        |   6 +-
 sys/arch/arm/gemini/if_gpn.c             |   6 +-
 sys/arch/arm/imx/if_enet.c               |   6 +-
 sys/arch/arm/omap/if_cpsw.c              |   6 +-
 sys/arch/arm/omap/omapl1x_emac.c         |   4 +-
 sys/arch/arm/sunxi/sun4i_emac.c          |   6 +-
 sys/arch/arm/sunxi/sunxi_emac.c          |   6 +-
 sys/arch/arm/ti/if_cpsw.c                |   6 +-
 sys/arch/arm/xscale/ixp425_if_npe.c      |   6 +-
 sys/arch/emips/ebus/if_le_ebus.c         |   6 +-
 sys/arch/mac68k/dev/if_mc.c              |   6 +-
 sys/arch/mac68k/nubus/if_netdock_nubus.c |   6 +-
 sys/arch/macppc/dev/am79c950.c           |   6 +-
 sys/arch/macppc/dev/if_bm.c              |   6 +-
 sys/arch/macppc/dev/if_gm.c              |   6 +-
 sys/arch/mips/adm5120/dev/if_admsw.c     |   6 +-
 sys/arch/mips/alchemy/dev/if_aumac.c     |   6 +-
 sys/arch/mips/atheros/dev/if_ae.c        |   6 +-
 sys/arch/mips/cavium/dev/if_cnmac.c      |   6 +-
 sys/arch/mips/ralink/ralink_eth.c        |   6 +-
 sys/arch/mips/sibyte/dev/sbmac.c         |   6 +-
 sys/arch/newsmips/apbus/if_sn.c          |   6 +-
 sys/arch/next68k/dev/mb8795.c            |   6 +-
 sys/arch/playstation2/dev/if_smap.c      |   6 +-
 sys/arch/powerpc/booke/dev/pq3etsec.c    |   6 +-
 sys/arch/powerpc/ibm4xx/dev/if_emac.c    |   6 +-
 sys/arch/sgimips/hpc/if_sq.c             |   6 +-
 sys/arch/sgimips/mace/if_mec.c           |   6 +-
 sys/arch/sun2/dev/if_ec.c                |   6 +-
 sys/arch/sun3/dev/if_ie.c                |   6 +-
 sys/arch/usermode/dev/if_veth.c          |   6 +-
 sys/arch/x86/pci/if_vmx.c                |   6 +-
 sys/arch/xen/xen/if_xennet_xenbus.c      |   6 +-
 sys/arch/xen/xen/xennetback_xenbus.c     |   8 +-
 sys/dev/bi/if_ni.c                       |   6 +-
 sys/dev/cadence/if_cemac.c               |   6 +-
 sys/dev/ic/aic6915.c                     |   6 +-
 sys/dev/ic/am7990.c                      |   6 +-
 sys/dev/ic/am79900.c                     |   6 +-
 sys/dev/ic/an.c                          |  14 +++--
 sys/dev/ic/arn5008.c                     |   8 +-
 sys/dev/ic/arn9003.c                     |   8 +-
 sys/dev/ic/ath.c                         |  13 ++--
 sys/dev/ic/athn.c                        |   8 +-
 sys/dev/ic/atw.c                         |  12 ++--
 sys/dev/ic/awi.c                         |   8 +-
 sys/dev/ic/bwfm.c                        |   4 +-
 sys/dev/ic/bwi.c                         |  12 ++--
 sys/dev/ic/cs89x0.c                      |   6 +-
 sys/dev/ic/dm9000.c                      |   4 +-
 sys/dev/ic/dp8390.c                      |   6 +-
 sys/dev/ic/dp83932.c                     |   6 +-
 sys/dev/ic/dwc_gmac.c                    |   6 +-
 sys/dev/ic/elink3.c                      |   6 +-
 sys/dev/ic/elinkxl.c                     |   6 +-
 sys/dev/ic/gem.c                         |   6 +-
 sys/dev/ic/hd64570.c                     |   6 +-
 sys/dev/ic/hme.c                         |   6 +-
 sys/dev/ic/i82557.c                      |   6 +-
 sys/dev/ic/i82586.c                      |   6 +-
 sys/dev/ic/i82596.c                      |   6 +-
 sys/dev/ic/lan9118.c                     |   6 +-
 sys/dev/ic/lemac.c                       |   6 +-
 sys/dev/ic/malo.c                        |  15 +++--
 sys/dev/ic/mb86950.c                     |   6 +-
 sys/dev/ic/mb86960.c                     |   6 +-
 sys/dev/ic/midway.c                      |   6 +-
 sys/dev/ic/mtd803.c                      |   6 +-
 sys/dev/ic/pdq_ifsubr.c                  |   6 +-
 sys/dev/ic/pdqvar.h                      |   6 +-
 sys/dev/ic/rrunner.c                     |   6 +-
 sys/dev/ic/rt2560.c                      |  19 ++++---
 sys/dev/ic/rt2661.c                      |  17 +++---
 sys/dev/ic/rt2860.c                      |  12 ++--
 sys/dev/ic/rtl8169.c                     |   6 +-
 sys/dev/ic/rtl81x9.c                     |   6 +-
 sys/dev/ic/rtw.c                         |  12 ++--
 sys/dev/ic/seeq8005.c                    |   6 +-
 sys/dev/ic/sgec.c                        |   6 +-
 sys/dev/ic/smc83c170.c                   |   6 +-
 sys/dev/ic/smc90cx6.c                    |   6 +-
 sys/dev/ic/smc91cxx.c                    |   6 +-
 sys/dev/ic/tropic.c                      |   8 +-
 sys/dev/ic/tulip.c                       |   6 +-
 sys/dev/ic/wi.c                          |  14 +++--
 sys/dev/if_ndis/if_ndis.c                |   6 +-
 sys/dev/isa/if_eg.c                      |   6 +-
 sys/dev/isa/if_el.c                      |   6 +-
 sys/dev/isa/if_iy.c                      |   6 +-
 sys/dev/marvell/if_gfe.c                 |   6 +-
 sys/dev/marvell/if_mvgbe.c               |   6 +-
 sys/dev/marvell/if_mvxpe.c               |   6 +-
 sys/dev/ofw/ofnet.c                      |   6 +-
 sys/dev/pci/cxgb/cxgb_main.c             |   4 +-
 sys/dev/pci/if_age.c                     |   6 +-
 sys/dev/pci/if_alc.c                     |   4 +-
 sys/dev/pci/if_ale.c                     |   6 +-
 sys/dev/pci/if_bce.c                     |   6 +-
 sys/dev/pci/if_bge.c                     |   6 +-
 sys/dev/pci/if_bnx.c                     |   6 +-
 sys/dev/pci/if_cas.c                     |   6 +-
 sys/dev/pci/if_de.c                      |   6 +-
 sys/dev/pci/if_dge.c                     |   6 +-
 sys/dev/pci/if_ena.c                     |   4 +-
 sys/dev/pci/if_et.c                      |   6 +-
 sys/dev/pci/if_ipw.c                     |  12 ++--
 sys/dev/pci/if_iwi.c                     |  12 ++--
 sys/dev/pci/if_iwm.c                     |  12 ++--
 sys/dev/pci/if_iwn.c                     |  12 ++--
 sys/dev/pci/if_jme.c                     |   6 +-
 sys/dev/pci/if_kse.c                     |   6 +-
 sys/dev/pci/if_lii.c                     |   6 +-
 sys/dev/pci/if_lmc.c                     |   6 +-
 sys/dev/pci/if_msk.c                     |   6 +-
 sys/dev/pci/if_nfe.c                     |   6 +-
 sys/dev/pci/if_pcn.c                     |   6 +-
 sys/dev/pci/if_rtwn.c                    |  12 ++--
 sys/dev/pci/if_sip.c                     |   6 +-
 sys/dev/pci/if_sk.c                      |   6 +-
 sys/dev/pci/if_ste.c                     |   6 +-
 sys/dev/pci/if_stge.c                    |   6 +-
 sys/dev/pci/if_ti.c                      |   6 +-
 sys/dev/pci/if_tl.c                      |   6 +-
 sys/dev/pci/if_txp.c                     |   6 +-
 sys/dev/pci/if_vge.c                     |   6 +-
 sys/dev/pci/if_vioif.c                   |   6 +-
 sys/dev/pci/if_vr.c                      |   6 +-
 sys/dev/pci/if_vte.c                     |   6 +-
 sys/dev/pci/if_wm.c                      |   8 +-
 sys/dev/pci/if_wpi.c                     |  14 ++--
 sys/dev/pci/if_xge.c                     |   6 +-
 sys/dev/pci/ixgbe/ix_txrx.c              |   6 +-
 sys/dev/pcmcia/if_cnw.c                  |   6 +-
 sys/dev/pcmcia/if_malo_pcmcia.c          |   6 +-
 sys/dev/pcmcia/if_ray.c                  |   8 +-
 sys/dev/pcmcia/if_xi.c                   |   6 +-
 sys/dev/ppbus/if_plip.c                  |  14 ++--
 sys/dev/qbus/if_de.c                     |   6 +-
 sys/dev/qbus/if_qe.c                     |   6 +-
 sys/dev/qbus/if_qt.c                     |   6 +-
 sys/dev/sbus/be.c                        |   6 +-
 sys/dev/sbus/qe.c                        |   6 +-
 sys/dev/scsipi/if_se.c                   |   6 +-
 sys/dev/usb/if_athn_usb.c                |  12 ++--
 sys/dev/usb/if_atu.c                     |   8 +-
 sys/dev/usb/if_aue.c                     |   6 +-
 sys/dev/usb/if_axe.c                     |   6 +-
 sys/dev/usb/if_axen.c                    |   6 +-
 sys/dev/usb/if_cdce.c                    |   6 +-
 sys/dev/usb/if_cue.c                     |   6 +-
 sys/dev/usb/if_kue.c                     |   6 +-
 sys/dev/usb/if_otus.c                    |  12 ++--
 sys/dev/usb/if_rum.c                     |  14 ++--
 sys/dev/usb/if_run.c                     |  12 ++--
 sys/dev/usb/if_smsc.c                    |   4 +-
 sys/dev/usb/if_udav.c                    |   6 +-
 sys/dev/usb/if_upgt.c                    |  15 +++--
 sys/dev/usb/if_upl.c                     |   6 +-
 sys/dev/usb/if_ural.c                    |  16 +++---
 sys/dev/usb/if_url.c                     |   6 +-
 sys/dev/usb/if_urndis.c                  |   6 +-
 sys/dev/usb/if_urtw.c                    |  14 ++--
 sys/dev/usb/if_urtwn.c                   |  12 ++--
 sys/dev/usb/if_zyd.c                     |  16 +++---
 sys/dev/usb/uhso.c                       |   8 +-
 sys/dist/pf/net/if_pflog.c               |   6 +-
 sys/dist/pf/net/if_pfsync.c              |   6 +-
 sys/net/agr/if_agr.c                     |   6 +-
 sys/net/bpf.c                            |  79 +++++++++++++++++++------------
 sys/net/bpf.h                            |  43 +++++++++++-----
 sys/net/bpfdesc.h                        |   6 +-
 sys/net/if.c                             |   8 +-
 sys/net/if_etherip.c                     |   6 +-
 sys/net/if_faith.c                       |   6 +-
 sys/net/if_gif.c                         |  10 ++--
 sys/net/if_gre.c                         |   8 +-
 sys/net/if_ieee1394subr.c                |   8 +-
 sys/net/if_ipsec.c                       |   8 +-
 sys/net/if_l2tp.c                        |   8 +-
 sys/net/if_loop.c                        |   6 +-
 sys/net/if_mpls.c                        |   8 +-
 sys/net/if_ppp.c                         |   8 +-
 sys/net/if_pppoe.c                       |  10 ++--
 sys/net/if_stf.c                         |   8 +-
 sys/net/if_tap.c                         |  10 ++--
 sys/net/if_tun.c                         |   8 +-
 sys/net/if_vlan.c                        |   8 +-
 sys/net/npf/npf_ext_log.c                |   6 +-
 sys/net80211/ieee80211_input.c           |  10 ++--
 sys/netcan/can.c                         |   7 +-
 sys/netinet/ip_carp.c                    |   6 +-
 sys/netisdn/i4b_ipr.c                    |   6 +-
 sys/netisdn/i4b_isppp.c                  |   6 +-
 sys/rump/net/lib/libshmif/if_shmem.c     |   6 +-
 sys/rump/net/lib/libsockin/sockin.c      |   8 +-
 sys/rump/net/lib/libvirtif/if_virt.c     |   6 +-
 usr.bin/fstat/misc.c                     |   8 +-
 usr.bin/netstat/bpf.c                    |   5 +-
 205 files changed, 840 insertions(+), 774 deletions(-)

diffs (truncated from 6850 to 300 lines):

diff -r 2f2e5ffe0958 -r 52f0978340b3 share/man/man4/bpf.4
--- a/share/man/man4/bpf.4      Tue Jun 26 06:34:55 2018 +0000
+++ b/share/man/man4/bpf.4      Tue Jun 26 06:47:57 2018 +0000
@@ -1,6 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\"    $NetBSD: bpf.4,v 1.60 2018/01/13 23:43:46 wiz Exp $
+.\"    $NetBSD: bpf.4,v 1.61 2018/06/26 06:47:57 msaitoh Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1992, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -24,7 +24,7 @@
 .\" This document is derived in part from the enet man page (enet.4)
 .\" distributed with 4.3BSD Unix.
 .\"
-.Dd July 24, 2014
+.Dd June 22, 2018
 .Dt BPF 4
 .Os
 .Sh NAME
@@ -297,13 +297,34 @@
 as provided, to the wire.
 This flag is initialized to zero by default.
 .It Dv BIOCGSEESENT , BIOCSSEESENT ( u_int )
-Enable/disable or get the
-.Dq see sent
-flag status.
-If enabled, packets sent by the host (not from
-.Nm )
-will be passed to the filter.
-By default, the flag is enabled (value is 1).
+These commands are obsolete but left for compatibility.
+Use
+.Dv BIOCSDIRECTION
+and
+.Dv BIOCGDIRECTION
+instead.
+Set or get the flag determining whether locally generated packets on the
+interface should be returned by BPF.
+Set to zero to see only incoming packets on the interface.
+Set to one to see packets originating locally and remotely on the interface.
+This flag is initialized to one by default.
+.It Dv BIOCSDIRECTION
+.It Dv BIOCGDIRECTION
+.Pq Li u_int
+Set or get the setting determining whether incoming, outgoing, or all packets
+on the interface should be returned by BPF.
+Set to
+.Dv BPF_D_IN
+to see only incoming packets on the interface.
+Set to
+.Dv BPF_D_INOUT
+to see packets originating locally and remotely on the interface.
+Set to
+.Dv BPF_D_OUT
+to see only outgoing packets on the interface.
+This setting is initialized to
+.Dv BPF_D_INOUT
+by default.
 .It Dv BIOCFEEDBACK , BIOCSFEEDBACK , BIOCGFEEDBACK ( u_int )
 Set (or get)
 .Dq packet feedback mode .
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/acorn32/podulebus/if_ie.c
--- a/sys/arch/acorn32/podulebus/if_ie.c        Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/acorn32/podulebus/if_ie.c        Tue Jun 26 06:47:57 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.41 2018/06/22 04:17:40 msaitoh Exp $ */
+/* $NetBSD: if_ie.c,v 1.42 2018/06/26 06:47:57 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1995 Melvin Tang-Richardson.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.41 2018/06/22 04:17:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.42 2018/06/26 06:47:57 msaitoh Exp $");
 
 #define IGNORE_ETHER1_IDROM_CHECKSUM
 
@@ -1483,7 +1483,7 @@
                        len += m->m_len;
                }
 
-               bpf_mtap(ifp, m0);
+               bpf_mtap(ifp, m0, BPF_D_OUT);
 
                m_freem(m0);
                if (len < ETHER_MIN_LEN - ETHER_CRC_LEN) {
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/amiga/dev/if_es.c
--- a/sys/arch/amiga/dev/if_es.c        Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/amiga/dev/if_es.c        Tue Jun 26 06:47:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_es.c,v 1.58 2018/06/22 04:17:40 msaitoh Exp $ */
+/*     $NetBSD: if_es.c,v 1.59 2018/06/26 06:47:57 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1995 Michael L. Hitch
@@ -33,7 +33,7 @@
 #include "opt_ns.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.58 2018/06/22 04:17:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.59 2018/06/26 06:47:57 msaitoh Exp $");
 
 
 #include <sys/param.h>
@@ -919,7 +919,7 @@
                if (smc->b2.pnr != active_pnr)
                        printf("%s: esstart - PNR changed %x->%x\n",
                            device_xname(sc->sc_dev), active_pnr, smc->b2.pnr);
-               bpf_mtap(&sc->sc_ethercom.ec_if, m0);
+               bpf_mtap(&sc->sc_ethercom.ec_if, m0, BPF_D_OUT);
                m_freem(m0);
                sc->sc_ethercom.ec_if.if_opackets++;    /* move to interrupt? */
                sc->sc_intctl |= MSK_TX_EMPTY | MSK_TX;
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/amiga/dev/if_qn.c
--- a/sys/arch/amiga/dev/if_qn.c        Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/amiga/dev/if_qn.c        Tue Jun 26 06:47:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_qn.c,v 1.45 2018/06/22 04:17:40 msaitoh Exp $ */
+/*     $NetBSD: if_qn.c,v 1.46 2018/06/26 06:47:57 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1995 Mika Kortelainen
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.45 2018/06/22 04:17:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.46 2018/06/26 06:47:57 msaitoh Exp $");
 
 #include "qn.h"
 #if NQN > 0
@@ -400,7 +400,7 @@
         * (can't give the copy in QuickNet card RAM to bpf, because
         * that RAM is not visible to the host but is read from FIFO)
         */
-       bpf_mtap(ifp, m);
+       bpf_mtap(ifp, m, BPF_D_OUT);
        len = qn_put(sc->nic_fifo, m);
        m_freem(m);
 
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/arm/at91/at91emac.c
--- a/sys/arch/arm/at91/at91emac.c      Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/arm/at91/at91emac.c      Tue Jun 26 06:47:57 2018 +0000
@@ -1,5 +1,5 @@
-/*     $Id: at91emac.c,v 1.20 2018/06/22 04:17:40 msaitoh Exp $        */
-/*     $NetBSD: at91emac.c,v 1.20 2018/06/22 04:17:40 msaitoh Exp $    */
+/*     $Id: at91emac.c,v 1.21 2018/06/26 06:47:57 msaitoh Exp $        */
+/*     $NetBSD: at91emac.c,v 1.21 2018/06/26 06:47:57 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2007 Embedtronics Oy
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.20 2018/06/22 04:17:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.21 2018/06/26 06:47:57 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -673,7 +673,7 @@
                IFQ_DEQUEUE(&ifp->if_snd, m);
        }
 
-       bpf_mtap(ifp, m);
+       bpf_mtap(ifp, m, BPF_D_OUT);
 
        nsegs = sc->txq[bi].m_dmamap->dm_nsegs;
        segs = sc->txq[bi].m_dmamap->dm_segs;
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/arm/broadcom/bcm53xx_eth.c
--- a/sys/arch/arm/broadcom/bcm53xx_eth.c       Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_eth.c       Tue Jun 26 06:47:57 2018 +0000
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.30 2017/10/23 09:23:25 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.31 2018/06/26 06:47:57 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -1663,7 +1663,7 @@
                        printf("%s: mbuf %p: consumed a %u byte packet\n",
                            __func__, m, m->m_pkthdr.len);
 #endif
-                       bpf_mtap(ifp, m);
+                       bpf_mtap(ifp, m, BPF_D_OUT);
                        ifp->if_opackets++;
                        ifp->if_obytes += m->m_pkthdr.len;
                        if (m->m_flags & M_MCAST)
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/arm/ep93xx/epe.c
--- a/sys/arch/arm/ep93xx/epe.c Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/arm/ep93xx/epe.c Tue Jun 26 06:47:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: epe.c,v 1.37 2018/06/22 04:17:40 msaitoh Exp $ */
+/*     $NetBSD: epe.c,v 1.38 2018/06/26 06:47:57 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.37 2018/06/22 04:17:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.38 2018/06/26 06:47:57 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -599,7 +599,7 @@
                IFQ_DEQUEUE(&ifp->if_snd, m);
        }
 
-       bpf_mtap(ifp, m);
+       bpf_mtap(ifp, m, BPF_D_OUT);
 
        nsegs = sc->txq[bi].m_dmamap->dm_nsegs;
        segs = sc->txq[bi].m_dmamap->dm_segs;
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/arm/gemini/gemini_gmac.c
--- a/sys/arch/arm/gemini/gemini_gmac.c Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/arm/gemini/gemini_gmac.c Tue Jun 26 06:47:57 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gemini_gmac.c,v 1.15 2018/05/09 06:55:26 maxv Exp $ */
+/* $NetBSD: gemini_gmac.c,v 1.16 2018/06/26 06:47:57 msaitoh Exp $ */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -49,7 +49,7 @@
 
 #include <sys/gpio.h>
 
-__KERNEL_RCSID(0, "$NetBSD: gemini_gmac.c,v 1.15 2018/05/09 06:55:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gemini_gmac.c,v 1.16 2018/06/26 06:47:57 msaitoh Exp $");
 
 #define        SWFREEQ_DESCS   256     /* one page worth */
 #define        HWFREEQ_DESCS   256     /* one page worth */
@@ -548,7 +548,7 @@
        aprint_debug("gmac_hwqueue_txconsume(%p): %zu@%p: %s m=%p\n",
            hwq, d - hwq->hwq_base, d, ifp->if_xname, m);
 
-       bpf_mtap(ifp, m);
+       bpf_mtap(ifp, m, BPF_D_OUT);
        m_freem(m);
 }
 
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/arm/gemini/if_gpn.c
--- a/sys/arch/arm/gemini/if_gpn.c      Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/arm/gemini/if_gpn.c      Tue Jun 26 06:47:57 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gpn.c,v 1.8 2017/06/25 12:44:04 maxv Exp $ */
+/* $NetBSD: if_gpn.c,v 1.9 2018/06/26 06:47:57 msaitoh Exp $ */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include "opt_gemini.h"
 
-__KERNEL_RCSID(0, "$NetBSD: if_gpn.c,v 1.8 2017/06/25 12:44:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gpn.c,v 1.9 2018/06/26 06:47:57 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -404,7 +404,7 @@
                        return;
                }
 
-               bpf_mtap(ifp, m);
+               bpf_mtap(ifp, m, BPF_D_OUT);
 #ifdef GPNDEBUG
                printf("%s: tx len=%d crc=%#x\n", ifp->if_xname,
                    m->m_pkthdr.len, m_crc32_le(m));
diff -r 2f2e5ffe0958 -r 52f0978340b3 sys/arch/arm/imx/if_enet.c
--- a/sys/arch/arm/imx/if_enet.c        Tue Jun 26 06:34:55 2018 +0000
+++ b/sys/arch/arm/imx/if_enet.c        Tue Jun 26 06:47:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_enet.c,v 1.13 2018/05/08 06:11:45 maxv Exp $        */
+/*     $NetBSD: if_enet.c,v 1.14 2018/06/26 06:47:57 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2014 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.13 2018/05/08 06:11:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.14 2018/06/26 06:47:57 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -916,7 +916,7 @@
                }
 
                /* Pass the packet to any BPF listeners */
-               bpf_mtap(ifp, m);
+               bpf_mtap(ifp, m, BPF_D_OUT);
        }
 



Home | Main Index | Thread Index | Old Index