Source-Changes-HG archive

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

[src/trunk]: src/sys/net For the trivial case where the packet is only in one...



details:   https://anonhg.NetBSD.org/src/rev/7b658bc6f2b2
branches:  trunk
changeset: 536587:7b658bc6f2b2
user:      darrenr <darrenr%NetBSD.org@localhost>
date:      Thu Sep 19 01:16:58 2002 +0000

description:
For the trivial case where the packet is only in one mbuf, call bpf_tap()
(idea from FreeBSD) - alternative to changing bpf_filter() to be aware of
kernel calling convetion where 0 is passed as the length for mbufs.

diffstat:

 sys/net/bpf.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r aacfedb90aee -r 7b658bc6f2b2 sys/net/bpf.c
--- a/sys/net/bpf.c     Thu Sep 19 00:52:54 2002 +0000
+++ b/sys/net/bpf.c     Thu Sep 19 01:16:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.70 2002/09/19 00:34:00 darrenr Exp $ */
+/*     $NetBSD: bpf.c,v 1.71 2002/09/19 01:16:58 darrenr Exp $ */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.70 2002/09/19 00:34:00 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.71 2002/09/19 01:16:58 darrenr Exp $");
 
 #include "bpfilter.h"
 
@@ -1138,6 +1138,11 @@
                        pktlen += m0->m_len;
        }
 
+       if (pktlen == m->m_len) {
+               bpf_tap(arg, mtod(m, u_char *), pktlen);
+               return;
+       }
+
        for (d = bp->bif_dlist; d != 0; d = d->bd_next) {
                ++d->bd_rcount;
                slen = bpf_filter(d->bd_filter, (u_char *)m, pktlen, 0);



Home | Main Index | Thread Index | Old Index