From 3a590217ac60d626cb126aff593b43901585224c Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Mon, 13 Jun 2016 15:28:16 -0400 Subject: Change how dissectors do late-field-registration to avoid a double-registration assertion. If a dissector forces registration of fields during dissection it needs to do so in a way that clears the prefix registration. Otherwise epan will call the registration routine a 2nd time (which will cause us to assert out) if a user types a display filter (with the dissector's prefix) that doesn't exist. Update the proto_register_prefix() comments to reflect this. Change-Id: I3ce29243395fb55192bb5dfd950baa88410ac136 Reviewed-on: https://code.wireshark.org/review/15881 Petri-Dish: Jeff Morriss Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter --- plugins/wimaxasncp/packet-wimaxasncp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c index d1dca91b70..8e3e781d24 100644 --- a/plugins/wimaxasncp/packet-wimaxasncp.c +++ b/plugins/wimaxasncp/packet-wimaxasncp.c @@ -2081,9 +2081,6 @@ match_ver_value_string( return res? res->vs.strptr : NULL; } -static void register_wimaxasncp_fields(const char*); - - static int dissect_wimaxasncp( tvbuff_t *tvb, @@ -2158,9 +2155,9 @@ dissect_wimaxasncp( offset = 0; /* Register protocol fields, etc if haven't done yet. */ - if (wimaxasncp_dict == NULL) + if (hf_wimaxasncp_version == -1) { - register_wimaxasncp_fields(NULL); + proto_registrar_get_byname("wimaxasncp.version"); } if (tree) -- cgit v1.2.3