aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
diff options
context:
space:
mode:
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-21 13:22:38 +0000
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-21 13:22:38 +0000
commit4be91c902fa00dd8034cfc5cfcfe49d96562db0c (patch)
tree8bc7aec6442df25a052234489841db151914f247 /capture_sync.c
parentb24810721b84c39a20d6e0e39ef291d849802db5 (diff)
Fix the capturing from the GUI. Honor the iface variable.
The next step is to retire the iface variable and use the ifaces array only. This should simplify things and fix the cases, where you start wireshark with command line arguments and also use the GUI. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37342 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_sync.c')
-rw-r--r--capture_sync.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/capture_sync.c b/capture_sync.c
index 191cd198fd..dec9522fe1 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -361,6 +361,7 @@ sync_pipe_start(capture_options *capture_opts) {
int i;
guint j;
interface_options interface_opts;
+ gboolean no_ifaces;
if (capture_opts->ifaces->len > 1)
capture_opts->use_pcapng = TRUE;
@@ -426,6 +427,7 @@ sync_pipe_start(capture_options *capture_opts) {
argv = sync_pipe_add_arg(argv, &argc, sautostop_duration);
}
if (capture_opts->ifaces->len == 0) {
+ no_ifaces = TRUE;
interface_opts.name = g_strdup(capture_opts->iface);
if (capture_opts->iface_descr) {
interface_opts.descr = g_strdup(capture_opts->iface_descr);
@@ -472,6 +474,8 @@ sync_pipe_start(capture_options *capture_opts) {
interface_opts.sampling_param = capture_opts->sampling_param;
#endif
g_array_append_val(capture_opts->ifaces, interface_opts);
+ } else {
+ no_ifaces = FALSE;
}
for (j = 0; j < capture_opts->ifaces->len; j++) {
@@ -541,6 +545,9 @@ sync_pipe_start(capture_options *capture_opts) {
}
#endif
}
+ if (no_ifaces) {
+ capture_opts->ifaces = g_array_remove_index(capture_opts->ifaces, 0);
+ }
/* dumpcap should be running in capture child mode (hidden feature) */
#ifndef DEBUG_CHILD