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

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