Cache the malformed filter instead of looking it up each time a malformed packet comes in. This drastically speeds up the load time of captures with lots of malformed packets (ie fuzztesting).

svn path=/trunk/; revision=50313
This commit is contained in:
Michael Mann 2013-07-02 16:02:31 +00:00
parent 0643b22517
commit ecc4e4789e
1 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,8 @@
*/
int proto_expert = -1;
static int proto_malformed = -1;
static int expert_tap = -1;
static int highest_severity = 0;
@ -112,6 +114,8 @@ expert_packet_init(void)
if (expert_modules == NULL) {
expert_modules = pe_tree_create(EMEM_TREE_TYPE_RED_BLACK, "expert_modules");
}
proto_malformed = proto_get_id_by_filter_name("malformed");
}
void
@ -271,7 +275,6 @@ expert_create_tree(proto_item *pi, int group, int severity, const char *msg)
if (group == PI_MALFORMED) {
/* Add hidden malformed protocol filter */
gint proto_malformed = proto_get_id_by_filter_name("malformed");
proto_item *malformed_ti = proto_tree_add_item(tree, proto_malformed, NULL, 0, 0, ENC_NA);
PROTO_ITEM_SET_HIDDEN(malformed_ti);
}