aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2017-12-11 14:41:58 -0800
committerGerald Combs <gerald@wireshark.org>2017-12-11 23:29:00 +0000
commit34b62c60bfad56275dca48242c7e477f33b691ef (patch)
tree3370b3a9df2ce98d09a75419da725f3e97fb8b11 /capture_opts.c
parent10e98462520b5dcfa1e5d7b80e53a95725d91d94 (diff)
Revert "Move fill_in_local_interfaces to a thread."
Calling scan_local_interfaces ends up calling fork via extcap. Doing so from a thread is ill-adivsed: https://rachelbythebay.com/w/2014/08/16/forkenv/ http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them This reverts commit 5b4894b7959f44e077f36194c490cbf402e1e659. Revert "fix compilation without pcap." as well. This reverts commit 51300b3c834a3877d567fb57ae78ec74ec8ba80d. Change-Id: Ic80582b52398c44af73c6d74dbb3216c4d1b37fc Reviewed-on: https://code.wireshark.org/review/24772 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 9e6991cc40..f7eb768082 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -13,10 +13,6 @@
#include <stdio.h>
#include <stdlib.h>
-#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP)
-#include "capture_opts.h"
-#endif
-
#ifdef HAVE_LIBPCAP
#include <string.h>
@@ -25,6 +21,7 @@
#include <glib.h>
+#include "capture_opts.h"
#include "ringbuffer.h"
#include <wsutil/clopts_common.h>
@@ -37,9 +34,8 @@
#include "ui/filter_files.h"
static gboolean capture_opts_output_to_pipe(const char *save_file, gboolean *is_pipe);
-#endif
-#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP)
+
void
capture_opts_init(capture_options *capture_opts)
{
@@ -50,9 +46,7 @@ capture_opts_init(capture_options *capture_opts)
capture_opts->default_options.descr = NULL;
capture_opts->default_options.cfilter = NULL;
capture_opts->default_options.has_snaplen = FALSE;
-#ifdef HAVE_LIBPCAP
capture_opts->default_options.snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
-#endif
capture_opts->default_options.linktype = -1; /* use interface default */
capture_opts->default_options.promisc_mode = TRUE;
capture_opts->default_options.if_type = IF_WIRED;
@@ -109,9 +103,8 @@ capture_opts_init(capture_options *capture_opts)
capture_opts->has_file_interval = FALSE;
capture_opts->file_interval = 60; /* 1 min */
capture_opts->has_ring_num_files = FALSE;
-#ifdef HAVE_LIBPCAP
capture_opts->ring_num_files = RINGBUFFER_MIN_NUM_FILES;
-#endif
+
capture_opts->has_autostop_files = FALSE;
capture_opts->autostop_files = 1;
capture_opts->has_autostop_packets = FALSE;
@@ -125,9 +118,7 @@ capture_opts_init(capture_options *capture_opts)
capture_opts->output_to_pipe = FALSE;
capture_opts->capture_child = FALSE;
}
-#endif
-#ifdef HAVE_LIBPCAP
void
capture_opts_cleanup(capture_options *capture_opts)
{