Source-Changes-HG archive

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

[src/netbsd-2-0]: src/usr.sbin/mopd/common Pullup rev 1.9 (requested by darre...



details:   https://anonhg.NetBSD.org/src/rev/85f998ea614c
branches:  netbsd-2-0
changeset: 560479:85f998ea614c
user:      jmc <jmc%NetBSD.org@localhost>
date:      Wed Apr 21 03:55:55 2004 +0000

description:
Pullup rev 1.9 (requested by darrenr in ticket #167)

Reduce bpf buffer to 32k from 1M to reduce kernel memory usage from userland
binaries.
Fix bpf so that select will return for a timeout.
Fix the behaviour of BIOCIMMEDIATE.
In bpf_mtap(), optimise the calling of bpf_filter() and catchpacket()
based on whether or not the entire packet is in one mbuf.
Various other bpf fixes, including PR#8674, PR#12170

diffstat:

 usr.sbin/mopd/common/pf.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 33e4e2e8f852 -r 85f998ea614c usr.sbin/mopd/common/pf.c
--- a/usr.sbin/mopd/common/pf.c Wed Apr 21 03:55:53 2004 +0000
+++ b/usr.sbin/mopd/common/pf.c Wed Apr 21 03:55:55 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pf.c,v 1.8 2003/04/20 00:17:22 christos Exp $  */
+/*     $NetBSD: pf.c,v 1.8.2.1 2004/04/21 03:55:55 jmc Exp $   */
 
 /*
  * Copyright (c) 1993-95 Mats O Jansson.  All rights reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: pf.c,v 1.8 2003/04/20 00:17:22 christos Exp $");
+__RCSID("$NetBSD: pf.c,v 1.8.2.1 2004/04/21 03:55:55 jmc Exp $");
 #endif
 
 #include "os.h"
@@ -82,6 +82,7 @@
        struct ifreq ifr;
        u_int   dlt;
        int     immediate;
+       u_int   bufsize;
 
        static struct bpf_insn insns[] = {
                BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),
@@ -115,6 +116,10 @@
                mopLogWarn("pfInit: BIOCIMMEDIATE");
                return(-1);
        }
+       bufsize = 32768;
+       if (ioctl(fd, BIOCSBLEN, &bufsize) < 0) {
+               mopLogWarn("pfInit: BIOCSBLEN(%d)", bufsize);
+       }
        (void) strncpy(ifr.ifr_name, interface, sizeof ifr.ifr_name);
        if (ioctl(fd, BIOCSETIF, (caddr_t) & ifr) < 0) {
                mopLogWarn("pfInit: BIOCSETIF");



Home | Main Index | Thread Index | Old Index