tcpdump mailing list archives
Re: Buffer size question
From: "Ed Maste" <emaste () sandvine com>
Date: Thu, 14 Oct 2004 14:29:14 -0400
I'll download one of the nightly tars and try out the environment variable idea.
Here's my simple patch to allow an environment variable
PCAP_BUFSIZE to override the default initial buffer size.
--- pcap-bpf.c Tue Oct 5 03:23:39 2004
+++ pcap-bpf.c.new Thu Oct 14 14:21:41 2004
@@ -578,6 +578,7 @@
u_int v;
pcap_t *p;
struct utsname osinfo;
+ char *cp;
#ifdef HAVE_DAG_API
if (strstr(device, "dag")) {
@@ -626,6 +627,8 @@
*/
if ((ioctl(fd, BIOCGBLEN, (caddr_t)&v) < 0) || v < 32768)
v = 32768;
+ if ((cp = getenv("PCAP_BUFSIZE")))
+ v = atoi(cp);
for ( ; v != 0; v >>= 1) {
/* Ignore the return value - this is because the call fails
* on BPF systems that don't have kernel malloc. And if
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.
Current thread:
- Buffer size question Ed Maste (Oct 13)
- Re: Buffer size question Guy Harris (Oct 13)
- Re: Buffer size question Gianluca Varenni (Oct 14)
- Re: Buffer size question Guy Harris (Oct 14)
- Re: Buffer size question Gianluca Varenni (Oct 14)
- <Possible follow-ups>
- Re: Buffer size question Ed Maste (Oct 14)
- Re: Buffer size question Ed Maste (Oct 14)
- Re: Buffer size question Hannes Gredler (Oct 15)
- Re: Buffer size question Pekka Savola (Oct 15)
- Re: Buffer size question Guy Harris (Oct 15)
- Re: Buffer size question Hannes Gredler (Oct 15)
- Re: Buffer size question Ed Maste (Oct 15)
- Buffer size question Alexander Dupuy (Oct 18)
- Re: Buffer size question Guy Harris (Oct 18)
- Re: Buffer size question Ed Maste (Oct 18)
- Re: Buffer size question Guy Harris (Oct 18)
- Re: Buffer size question Guy Harris (Oct 13)
