diff --git a/epan/packet.c b/epan/packet.c index 489cc2d84b..af1f075e22 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -2881,6 +2881,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const char *dis hdtbl_entry->short_name = g_strdup(internal_name); hdtbl_entry->list_name = g_strdup(name); hdtbl_entry->enabled = (enable == HEURISTIC_ENABLE); + hdtbl_entry->enabled_by_default = (enable == HEURISTIC_ENABLE); /* do the table insertion */ g_hash_table_insert(heuristic_short_names, (gpointer)hdtbl_entry->short_name, hdtbl_entry); @@ -3159,7 +3160,7 @@ display_heur_dissector_table_entries(const char *table_name, table_name, proto_get_protocol_filter_name(proto_get_id(hdtbl_entry->protocol)), (proto_is_protocol_enabled(hdtbl_entry->protocol) && hdtbl_entry->enabled) ? 'T' : 'F', - (proto_is_protocol_enabled_by_default(hdtbl_entry->protocol) && hdtbl_entry->enabled) ? 'T' : 'F', + (proto_is_protocol_enabled_by_default(hdtbl_entry->protocol) && hdtbl_entry->enabled_by_default) ? 'T' : 'F', hdtbl_entry->short_name, hdtbl_entry->display_name); } diff --git a/epan/packet.h b/epan/packet.h index 805e99ac8d..b34da05d5b 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -469,6 +469,7 @@ typedef struct heur_dtbl_entry { const gchar *display_name; /* the string used to present heuristic to user */ gchar *short_name; /* string used for "internal" use to uniquely identify heuristic */ gboolean enabled; + bool enabled_by_default; } heur_dtbl_entry_t; /** A protocol uses this function to register a heuristic sub-dissector list. diff --git a/epan/proto.c b/epan/proto.c index 4e41dece70..4bf1bd033f 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -8407,6 +8407,14 @@ proto_disable_all(void) } } +static void +heur_reenable_cb(void *data, void *user_data _U_) +{ + heur_dtbl_entry_t *heur = (heur_dtbl_entry_t*)data; + + heur->enabled = heur->enabled_by_default; +} + void proto_reenable_all(void) { @@ -8420,6 +8428,7 @@ proto_reenable_all(void) protocol = (protocol_t *)list_item->data; if (protocol->can_toggle) protocol->is_enabled = protocol->enabled_by_default; + proto_heuristic_dissector_foreach(protocol, heur_reenable_cb, NULL); list_item = g_list_next(list_item); } }