aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--capture_opts.c2
-rw-r--r--capture_opts.h3
-rw-r--r--capture_sync.c3
-rw-r--r--dumpcap.c2
-rw-r--r--ui/gtk/capture_dlg.c4
-rw-r--r--ui/iface_lists.c2
6 files changed, 9 insertions, 7 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 6ab046b41b..c297b1396f 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -70,7 +70,7 @@ capture_opts_init(capture_options *capture_opts, void *cf)
capture_opts->default_options.linktype = -1;
capture_opts->default_options.promisc_mode = TRUE;
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
- capture_opts->default_options.buffer_size = 2; /* 2 MB, In pcap-linux.c: by default request 2M for the ring buffer */
+ capture_opts->default_options.buffer_size = DEFAULT_CAPTURE_BUFFER_SIZE;
#endif
capture_opts->default_options.monitor_mode = FALSE;
#ifdef HAVE_PCAP_REMOTE
diff --git a/capture_opts.h b/capture_opts.h
index 236d371bf5..adc05bd5f0 100644
--- a/capture_opts.h
+++ b/capture_opts.h
@@ -270,6 +270,9 @@ capture_opts_trim_iface(capture_options *capture_opts, const char *capture_devic
extern void
collect_ifaces(capture_options *capture_opts);
+/* Default capture buffer size in Mbytes. */
+#define DEFAULT_CAPTURE_BUFFER_SIZE 2
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/capture_sync.c b/capture_sync.c
index b1bc13d70d..ad7378470b 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -461,8 +461,7 @@ sync_pipe_start(capture_options *capture_opts) {
}
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
- /* In pcap-linux.c: by default request 2M for the ring buffer */
- if (interface_opts.buffer_size != 2) {
+ if (interface_opts.buffer_size != DEFAULT_CAPTURE_BUFFER_SIZE) {
argv = sync_pipe_add_arg(argv, &argc, "-B");
g_snprintf(buffer_size, ARGV_NUMBER_LEN, "%d", interface_opts.buffer_size);
argv = sync_pipe_add_arg(argv, &argc, buffer_size);
diff --git a/dumpcap.c b/dumpcap.c
index 025337c2c9..fe93f1485a 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -452,7 +452,7 @@ print_usage(gboolean print_ver)
fprintf(output, " -I capture in monitor mode, if available\n");
#endif
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
- fprintf(output, " -B <buffer size> size of kernel buffer in MB (def: 2MB)\n");
+ fprintf(output, " -B <buffer size> size of kernel buffer in MB (def: %dMB)\n", DEFAULT_CAPTURE_BUFFER_SIZE);
#endif
fprintf(output, " -y <link type> link layer type (def: first appropriate)\n");
fprintf(output, " -D print list of interfaces and exit\n");
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
index 85adc27c64..8f92512a70 100644
--- a/ui/gtk/capture_dlg.c
+++ b/ui/gtk/capture_dlg.c
@@ -2590,7 +2590,7 @@ void options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColum
device.snaplen = 65535;
device.cfilter = NULL;
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
- device.buffer = 2;
+ device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
#endif
model = gtk_tree_view_get_model(view);
@@ -3370,7 +3370,7 @@ add_pipe_cb(gpointer w _U_)
device.last_packets = 0;
device.links = NULL;
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
- device.buffer = 2;
+ device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
#endif
device.active_dlt = -1;
device.locked = FALSE;
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index e7fd853ae3..b0537d251d 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -247,7 +247,7 @@ scan_local_interfaces(void)
device.snaplen = global_capture_opts.default_options.snaplen;
device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
- device.buffer = 2;
+ device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
#endif
if (global_capture_opts.ifaces->len > 0) {