From 1cee1c95cc8b0ff30419b08d477c8f512615cd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Mon, 4 Sep 2017 20:02:00 +0200 Subject: [PATCH] dumpcap: Detect extcap pipe from correct interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- dumpcap.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dumpcap.c b/dumpcap.c index c3f811ce1d..76fba65bcd 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -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