diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-10 11:47:46 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-10 19:48:10 +0000 |
commit | 02fb2908ff7884c5329db285d15d2efaa691a92e (patch) | |
tree | 74fa50ee7f8cf1e2b80fee6eab35be6e8554ea02 /epan | |
parent | 531a9f0eab2c4cbc23e57835601d0179e7ba65a8 (diff) |
Sort the value_string_exts at dissector registration time.
You *CANNOT* defer it until dissection time, otherwise "tshark -G
values" will fail.
Change-Id: I4edf9abda271baaf916f020a211b9add5543ecc7
Reviewed-on: https://code.wireshark.org/review/6481
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mq.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index 2b851020e9..5475e9a062 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -83,11 +83,6 @@ void proto_register_mq(void); void proto_reg_handoff_mq(void); -/* -used to only sort once some value_string_ext -*/ -static gboolean is_value_string_ext_sorted = FALSE; - static int proto_mq = -1; static int hf_mq_tsh_StructID = -1; static int hf_mq_tsh_mqseglen = -1; @@ -3838,7 +3833,6 @@ static void _try_mq_vals_sort(value_string_ext *pExt) } static void _mq_sort_value_string_ext(void) { - is_value_string_ext_sorted = TRUE; _try_mq_vals_sort(GET_VALS_EXTP(mqrc)); _try_mq_vals_sort(GET_VALS_EXTP(mqcmd)); _try_mq_vals_sort(GET_VALS_EXTP(PrmId)); @@ -3859,12 +3853,6 @@ static int reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo if (tvb_reported_length(tvb) < 28) return 0; - /* - Sort value_string_ext if not already done - */ - if (!is_value_string_ext_sorted) - _mq_sort_value_string_ext(); - memset(&mq_parm, 0, sizeof(mq_parm_t)); mq_parm.mq_strucID = tvb_get_ntohl(tvb, 0); @@ -4090,12 +4078,6 @@ static int dissect_mq_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v static void dissect_mq_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* - Sort value_string_ext if not already done - */ - if (!is_value_string_ext_sorted) - _mq_sort_value_string_ext(); - /* Since SPX has no standard desegmentation, MQ cannot be performed as well */ dissect_mq_pdu(tvb, pinfo, tree); } @@ -4801,6 +4783,11 @@ void proto_register_mq(void) module_t *mq_module; + /* + Sort value_string_exts + */ + _mq_sort_value_string_ext(); + proto_mq = proto_register_protocol("WebSphere MQ", "MQ", "mq"); proto_register_field_array(proto_mq, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); |