diff options
-rw-r--r-- | sharkd.c | 7 | ||||
-rw-r--r-- | sharkd_session.c | 9 |
2 files changed, 16 insertions, 0 deletions
@@ -52,6 +52,7 @@ #include "epan/register.h" #include <epan/epan_dissect.h> #include <epan/tap.h> +#include <epan/uat-int.h> #include <codecs/codecs.h> @@ -195,6 +196,12 @@ main(int argc, char *argv[]) /* Build the column format array */ build_column_format_array(&cfile.cinfo, prefs_p->num_cols, TRUE); +#ifdef HAVE_MAXMINDDB + /* mmdbresolve is started from mmdb_resolve_start(), which is called from epan_load_settings via: read_prefs -> (...) uat_load_all -> maxmind_db_post_update_cb. + * Need to stop it, otherwise all sharkd will have same mmdbresolve process, including pipe descriptors to read and write. */ + uat_clear(uat_get_table_by_name("MaxMind Database Paths")); +#endif + ret = sharkd_loop(); clean_exit: col_cleanup(&cfile.cinfo); diff --git a/sharkd_session.c b/sharkd_session.c index bffacf4b3e..96d09cdf8a 100644 --- a/sharkd_session.c +++ b/sharkd_session.c @@ -4003,6 +4003,11 @@ sharkd_session_main(void) filter_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, sharkd_session_filter_free); +#ifdef HAVE_MAXMINDDB + /* mmdbresolve was stopped before fork(), force starting it */ + uat_get_table_by_name("MaxMind Database Paths")->post_update_cb(); +#endif + while (fgets(buf, sizeof(buf), stdin)) { /* every command is line seperated JSON */ @@ -4033,6 +4038,10 @@ sharkd_session_main(void) return 2; } +#if defined(HAVE_C_ARES) || defined(HAVE_MAXMINDDB) + host_name_lookup_process(); +#endif + sharkd_session_process(buf, tokens, ret); } |