dumpcap: Detect extcap pipe from correct interface

When capturing from multiple interfaces the extcap pipe detection
must be done based on the correct interface, not the first one.

Change-Id: I7428388d84ee18d0bfa693ffc9ddae98126ceca4
Ping-Bug: 13653
Reviewed-on: https://code.wireshark.org/review/23390
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Stig Bjørlykke 2017-09-04 20:02:00 +02:00 committed by Roland Knall
parent d4efbc4101
commit 1cee1c95cc
1 changed files with 2 additions and 8 deletions

View File

@ -1504,7 +1504,6 @@ cap_pipe_open_live(char *pipename,
#endif
#ifdef HAVE_EXTCAP
gboolean extcap_pipe = FALSE;
interface_options *interface_opts;
#endif
ssize_t b;
int fd = -1, sel_ret;
@ -1532,14 +1531,9 @@ cap_pipe_open_live(char *pipename,
return;
}
} else {
#ifdef HAVE_EXTCAP
interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, 0);
#endif
#ifndef _WIN32
#ifdef HAVE_EXTCAP
if ( g_strrstr(interface_opts->name, EXTCAP_PIPE_PREFIX) != NULL )
if ( g_strrstr(pipename, EXTCAP_PIPE_PREFIX) != NULL )
extcap_pipe = TRUE;
#endif
@ -1653,7 +1647,7 @@ cap_pipe_open_live(char *pipename,
}
#ifdef HAVE_EXTCAP
extcap_pipe_name = g_strconcat("\\\\.\\pipe\\", EXTCAP_PIPE_PREFIX, NULL);
extcap_pipe = strstr(interface_opts->name, extcap_pipe_name) ? TRUE : FALSE;
extcap_pipe = strstr(pipename, extcap_pipe_name) ? TRUE : FALSE;
g_free(extcap_pipe_name);
#endif