aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2022-08-14 12:47:13 +0200
committerGerald Combs <gerald@wireshark.org>2022-08-14 16:05:22 +0000
commit424038102617984f2160fd51459643249ccbe4d2 (patch)
tree6cc6e71ce4d9989aedbd0200e188b87915385600 /capture_opts.c
parent298eabc36cf1d154113a0a1f46704329c3d8a83e (diff)
wsutil: Remove flawed ws_pipe_close() function
The semantics behind ws_pipe_close() were broken since its introduction. Forcing process termination on Windows, while simply setting variable on other systems results in more OS specific code sprinkled all over the place instead of less. Moreover ws_pipe_close() never handled standard file handles. It is really hard to come up with sensible ws_pipe_close() replacement, as process exit is actually asynchronous action. It is recommended to register child watch using g_child_watch_add() instead. Do not call ws_pipe_close() when deleting capture interface. Things will break if extcap is still running when interface opts are being freed and terminating process won't help. Rework maxmind shutdown to rely on GIOChannel state. For unknown reason TerminateProcess() is still needed on Windows. The actual root cause should be identified and fixed instead of giving up hope that it will ever work correctly on Windows. In other words, TerminateProcess() should not be used as a pattern, but rather as a last resort.
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 53c1800bb7..498aaacfc0 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -1291,7 +1291,7 @@ capture_opts_del_iface(capture_options *capture_opts, guint if_index)
if (interface_opts->extcap_args)
g_hash_table_unref(interface_opts->extcap_args);
if (interface_opts->extcap_pid != WS_INVALID_PID)
- ws_pipe_close((ws_pipe_t *) interface_opts->extcap_pipedata);
+ ws_warning("Extcap still running during interface delete");
g_free(interface_opts->extcap_pipedata);
if (interface_opts->extcap_stderr)
g_string_free(interface_opts->extcap_stderr, TRUE);