aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-snoop.c
diff options
context:
space:
mode:
authorguy <guy>2008-04-07 03:57:32 +0000
committerguy <guy>2008-04-07 03:57:32 +0000
commitb95b96d6da3af4e8a375e73fa538f476974e5d1a (patch)
treec4d558b18d72f4ef820232e080c32a4a41144315 /pcap-snoop.c
parent3df4925c28ee213aff7e526bbfb67cb79ddc6fef (diff)
For Linux non-mmapped captures, Linux bluetooth captures, and Irix
captures, set the socket buffer size to the value specified by pcap_set_buffer_size() if a value was set. Clean up if memory buffer allocation fails on Linux.
Diffstat (limited to 'pcap-snoop.c')
-rw-r--r--pcap-snoop.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pcap-snoop.c b/pcap-snoop.c
index bbcf140..6cc9bb8 100644
--- a/pcap-snoop.c
+++ b/pcap-snoop.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.56 2008-04-04 19:37:45 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.57 2008-04-07 03:57:32 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -234,7 +234,10 @@ pcap_activate_snoop(pcap_t *p)
pcap_strerror(errno));
goto bad;
}
- v = 64 * 1024;
+ if (handle->opt.buffer_size != 0)
+ v = handle->opt.buffer_size;
+ else
+ v = 64 * 1024; /* default to 64K buffer size */
(void)setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&v, sizeof(v));
/*
* XXX hack - map device name to link layer type