diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2016-06-13 15:28:16 -0400 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2016-06-15 05:38:01 +0000 |
commit | 3a590217ac60d626cb126aff593b43901585224c (patch) | |
tree | 0e75c2b174f6ef9ee1b5837c60cffe9d0515519b /epan/dissectors/packet-diameter.c | |
parent | 22fd85d178e52b23a192737f16957d24886d0a5d (diff) |
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 <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Diffstat (limited to 'epan/dissectors/packet-diameter.c')
-rw-r--r-- | epan/dissectors/packet-diameter.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c index 60a596aa53..45ff749036 100644 --- a/epan/dissectors/packet-diameter.c +++ b/epan/dissectors/packet-diameter.c @@ -1194,8 +1194,6 @@ static const int *diameter_flags_fields[] = { NULL }; -static void register_diameter_fields(const char *); - static int dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { @@ -1221,7 +1219,7 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi /* Load header fields if not already done */ if (hf_diameter_code == -1) - register_diameter_fields(""); + proto_registrar_get_byname("diameter.code"); diam_sub_dis_inf->application_id = tvb_get_ntohl(tvb,8); |