summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-02-06 22:38:59 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-02-06 22:38:59 +0000
commit72d59ef21c72c4554aa9dac9bed3bc02f7165483 (patch)
tree55c23283dff926796579b750e61b295794ad8860 /sys/net
parentc85890fbc0168626ae5ef8e7a9190efa92329ffd (diff)
as seen in netbsd. crank bpf sizes to adapt to faster networks.
max size goes to 2MB, default goes to 32k. ok canacar@ mcbride@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c9
-rw-r--r--sys/net/bpf.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index e10b0fb8770..7baa0c8acbc 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.42 2003/12/10 07:22:42 itojun Exp $ */
+/* $OpenBSD: bpf.c,v 1.43 2004/02/06 22:38:58 tedu Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -59,7 +59,7 @@
#include <netinet/if_arc.h>
#include <netinet/if_ether.h>
-#define BPF_BUFSIZE 9216 /* 8192 too small for ATM frames */
+#define BPF_BUFSIZE 32768
#define PRINET 26 /* interruptible */
@@ -67,6 +67,7 @@
* The default read buffer size is patchable.
*/
int bpf_bufsize = BPF_BUFSIZE;
+int bpf_maxbufsize = BPF_MAXBUFSIZE;
/*
* bpf_iflist is the list of interfaces; each corresponds to an ifnet
@@ -658,8 +659,8 @@ bpfioctl(dev, cmd, addr, flag, p)
else {
u_int size = *(u_int *)addr;
- if (size > BPF_MAXBUFSIZE)
- *(u_int *)addr = size = BPF_MAXBUFSIZE;
+ if (size > bpf_maxbufsize)
+ *(u_int *)addr = size = bpf_maxbufsize;
else if (size < BPF_MINBUFSIZE)
*(u_int *)addr = size = BPF_MINBUFSIZE;
d->bd_bufsize = size;
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
index 50e210ce5b6..a118ed946ed 100644
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.h,v 1.24 2003/10/22 18:42:40 canacar Exp $ */
+/* $OpenBSD: bpf.h,v 1.25 2004/02/06 22:38:58 tedu Exp $ */
/* $NetBSD: bpf.h,v 1.15 1996/12/13 07:57:33 mikel Exp $ */
/*
@@ -53,7 +53,7 @@ typedef u_int32_t bpf_u_int32;
#define BPF_WORDALIGN(x) (((x) + (BPF_ALIGNMENT - 1)) & ~(BPF_ALIGNMENT - 1))
#define BPF_MAXINSNS 512
-#define BPF_MAXBUFSIZE 0x80000
+#define BPF_MAXBUFSIZE (2 * 1024 * 1024)
#define BPF_MINBUFSIZE 32
/*