summaryrefslogtreecommitdiff
path: root/epan/expert.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-07-02 16:02:31 +0000
committerMichael Mann <mmann78@netscape.net>2013-07-02 16:02:31 +0000
commitecc4e4789ef969c859a62805c137f567f090ff4f (patch)
tree14efdedc6117330da0fbd5f8befb01cce8e1f29c /epan/expert.c
parent0643b225172c4acae9154e7bd0dc5073317b83e9 (diff)
downloadwireshark-ecc4e4789ef969c859a62805c137f567f090ff4f.tar.gz
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
Diffstat (limited to 'epan/expert.c')
-rw-r--r--epan/expert.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/epan/expert.c b/epan/expert.c
index 9022ca2012..ee38964d39 100644
--- a/epan/expert.c
+++ b/epan/expert.c
@@ -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);
}