summaryrefslogtreecommitdiff
path: root/capture_sync.c
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2011-05-21 13:22:38 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2011-05-21 13:22:38 +0000
commitc6c2577bbc97388be260fb677db3f730e1b372c3 (patch)
tree8bc7aec6442df25a052234489841db151914f247 /capture_sync.c
parent9be282951b1490764fc226296edb65c37ee1ea05 (diff)
downloadwireshark-c6c2577bbc97388be260fb677db3f730e1b372c3.tar.gz
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. svn path=/trunk/; revision=37342
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