Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/net/lib/libshmif Support bpf. shmif_dumpbus(1) can...



details:   https://anonhg.NetBSD.org/src/rev/44224e1c0035
branches:  trunk
changeset: 763112:44224e1c0035
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Mar 10 13:27:03 2011 +0000

description:
Support bpf.  shmif_dumpbus(1) can be used for much the same effect,
but sometimes it's just more convenient to run tcpdump live.

diffstat:

 sys/rump/net/lib/libshmif/if_shmem.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 1e92ac6c81f6 -r 44224e1c0035 sys/rump/net/lib/libshmif/if_shmem.c
--- a/sys/rump/net/lib/libshmif/if_shmem.c      Thu Mar 10 13:23:41 2011 +0000
+++ b/sys/rump/net/lib/libshmif/if_shmem.c      Thu Mar 10 13:27:03 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_shmem.c,v 1.34 2011/03/10 13:20:54 pooka Exp $      */
+/*     $NetBSD: if_shmem.c,v 1.35 2011/03/10 13:27:03 pooka Exp $      */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.34 2011/03/10 13:20:54 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.35 2011/03/10 13:27:03 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -38,6 +38,7 @@
 #include <sys/lock.h>
 #include <sys/vmem.h>
 
+#include <net/bpf.h>
 #include <net/if.h>
 #include <net/if_ether.h>
 
@@ -517,6 +518,8 @@
                sp.sp_sec = tv.tv_sec;
                sp.sp_usec = tv.tv_usec;
 
+               bpf_mtap(ifp, m0);
+
                shmif_lockbus(busmem);
                KASSERT(busmem->shm_magic == SHMIF_MAGIC);
                busmem->shm_last = shmif_nextpktoff(busmem, busmem->shm_last);
@@ -702,6 +705,7 @@
                if (memcmp(eth->ether_dhost, sc->sc_myaddr, 6) == 0 ||
                    memcmp(eth->ether_dhost, etherbroadcastaddr, 6) == 0) {
                        KERNEL_LOCK(1, NULL);
+                       bpf_mtap(ifp, m);
                        ifp->if_input(ifp, m);
                        KERNEL_UNLOCK_ONE(NULL);
                        m = NULL;



Home | Main Index | Thread Index | Old Index