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

ce5013
From 41d5020151d21ff0609a4c4173ef2a8ae41f754d Mon Sep 17 00:00:00 2001
8d0d63
From: rpm-build <rpm-build>
8d0d63
Date: Tue, 9 May 2017 10:17:42 +0200
ce5013
Subject: [PATCH 12/13] Make default capture buffer size bigger.
8d0d63
8d0d63
---
ce5013
 tcpdump.c | 9 ++++++++-
ce5013
 1 file changed, 8 insertions(+), 1 deletion(-)
8d0d63
8d0d63
diff --git a/tcpdump.c b/tcpdump.c
ce5013
index d7b094b..a54a42c 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
ce5013
 static long 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 */
ce5013
@@ -1011,7 +1012,13 @@ 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
+        }
ce5013
+
8d0d63
 #ifdef HAVE_PCAP_SET_TSTAMP_TYPE
8d0d63
 	if (jflag != -1) {
8d0d63
 		status = pcap_set_tstamp_type(pc, jflag);
8d0d63
-- 
ce5013
2.13.5
8d0d63