summaryrefslogtreecommitdiff
path: root/tfshark.c
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2015-12-29 07:57:36 +0100
committerMichael Mann <mmann78@netscape.net>2016-07-29 03:15:54 +0000
commit485bc456c57a16dbe50b76c476e48223038bb0e8 (patch)
tree5fabaa4504ccce8a08ddd23d8bbb8f9aaf60935a /tfshark.c
parent191f9bdbc50bd3993259d31dfeeaa95187984fed (diff)
downloadwireshark-485bc456c57a16dbe50b76c476e48223038bb0e8.tar.gz
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 <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'tfshark.c')
-rw-r--r--tfshark.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tfshark.c b/tfshark.c
index fe97057713..4bea91c727 100644
--- a/tfshark.c
+++ b/tfshark.c
@@ -80,6 +80,10 @@
#include <epan/dissectors/packet-kerberos.h>
#endif
+#ifdef HAVE_EXTCAP
+#include "extcap.h"
+#endif
+
#include <wiretap/wtap-int.h>
#include <wiretap/file_wrappers.h>
@@ -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);