From 485bc456c57a16dbe50b76c476e48223038bb0e8 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Tue, 29 Dec 2015 07:57:36 +0100 Subject: extcap: Restore functionality for options Allow stored options to be restored to their default values. This adds a global cleanup method for extcap and globally defined preference values, which fixes the parameter problem with windows Change-Id: I48e0cf846ef81f4732d652c6a2ad0020db5df08e Reviewed-on: https://code.wireshark.org/review/13741 Petri-Dish: Roland Knall Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- tfshark.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tfshark.c') diff --git a/tfshark.c b/tfshark.c index fe97057713..4bea91c727 100644 --- a/tfshark.c +++ b/tfshark.c @@ -80,6 +80,10 @@ #include #endif +#ifdef HAVE_EXTCAP +#include "extcap.h" +#endif + #include #include @@ -859,6 +863,9 @@ main(int argc, char *argv[]) * cruft getting in the way. Makes the results of running * $ ./tools/valgrind-wireshark -n * much more useful. */ +#ifdef HAVE_EXTCAP + extcap_cleanup(); +#endif epan_cleanup(); return 0; } @@ -987,6 +994,9 @@ main(int argc, char *argv[]) if (!dfilter_compile(rfilter, &rfcode, &err_msg)) { cmdarg_err("%s", err_msg); g_free(err_msg); +#ifdef HAVE_EXTCAP + extcap_cleanup(); +#endif epan_cleanup(); return 2; } @@ -997,6 +1007,9 @@ main(int argc, char *argv[]) if (!dfilter_compile(dfilter, &dfcode, &err_msg)) { cmdarg_err("%s", err_msg); g_free(err_msg); +#ifdef HAVE_EXTCAP + extcap_cleanup(); +#endif epan_cleanup(); return 2; } @@ -1042,6 +1055,9 @@ main(int argc, char *argv[]) /* TODO: if tfshark is ever changed to give the user a choice of which open_routine reader to use, then the following needs to change. */ if (cf_open(&cfile, cf_name, WTAP_TYPE_AUTO, FALSE, &err) != CF_OK) { +#ifdef HAVE_EXTCAP + extcap_cleanup(); +#endif epan_cleanup(); return 2; } @@ -1080,6 +1096,9 @@ main(int argc, char *argv[]) draw_tap_listeners(TRUE); funnel_dump_all_text_windows(); epan_free(cfile.epan); +#ifdef HAVE_EXTCAP + extcap_cleanup(); +#endif epan_cleanup(); output_fields_free(output_fields); -- cgit v1.2.1