Blame SOURCES/0012-Make-default-capture-buffer-size-bigger.patch

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