|
|
8d0d63 |
From 65cf72e5f47449ef053c099126949431e1d4d50b Mon Sep 17 00:00:00 2001
|
|
|
8d0d63 |
From: rpm-build <rpm-build>
|
|
|
8d0d63 |
Date: Tue, 9 May 2017 10:17:42 +0200
|
|
|
8d0d63 |
Subject: [PATCH] Make default capture buffer size bigger.
|
|
|
8d0d63 |
|
|
|
8d0d63 |
---
|
|
|
8d0d63 |
tcpdump.c | 8 +++++++-
|
|
|
8d0d63 |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
8d0d63 |
|
|
|
8d0d63 |
diff --git a/tcpdump.c b/tcpdump.c
|
|
|
8d0d63 |
index c7e2ebd..d0def76 100644
|
|
|
8d0d63 |
--- a/tcpdump.c
|
|
|
8d0d63 |
+++ b/tcpdump.c
|
|
|
8d0d63 |
@@ -130,6 +130,7 @@ The Regents of the University of California. All rights reserved.\n";
|
|
|
8d0d63 |
#endif
|
|
|
8d0d63 |
|
|
|
8d0d63 |
static int Bflag; /* buffer size */
|
|
|
8d0d63 |
+#define DEFAULT_CAPTURE_BUFFER_SIZE 4*1024*1024
|
|
|
8d0d63 |
static int Cflag; /* rotate dump files after this many bytes */
|
|
|
8d0d63 |
static int Cflag_count; /* Keep track of which file number we're writing */
|
|
|
8d0d63 |
static int Dflag; /* list available devices and exit */
|
|
|
8d0d63 |
@@ -1020,7 +1021,12 @@ open_interface(const char *device, netdissect_options *ndo, char *ebuf)
|
|
|
8d0d63 |
if (status != 0)
|
|
|
8d0d63 |
error("%s: Can't set buffer size: %s",
|
|
|
8d0d63 |
device, pcap_statustostr(status));
|
|
|
8d0d63 |
- }
|
|
|
8d0d63 |
+ } else {
|
|
|
8d0d63 |
+ Bflag = DEFAULT_CAPTURE_BUFFER_SIZE;
|
|
|
8d0d63 |
+ status = pcap_set_buffer_size(pc, Bflag);
|
|
|
8d0d63 |
+ if (status != 0)
|
|
|
8d0d63 |
+ fprintf(stderr, "Can't set buffer size to %d, using system default.\n", DEFAULT_CAPTURE_BUFFER_SIZE);
|
|
|
8d0d63 |
+ }
|
|
|
8d0d63 |
#ifdef HAVE_PCAP_SET_TSTAMP_TYPE
|
|
|
8d0d63 |
if (jflag != -1) {
|
|
|
8d0d63 |
status = pcap_set_tstamp_type(pc, jflag);
|
|
|
8d0d63 |
--
|
|
|
8d0d63 |
2.9.3
|
|
|
8d0d63 |
|