diff options
author | Michael Mann <mmann78@netscape.net> | 2016-06-30 20:41:45 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-07-01 14:26:20 +0000 |
commit | a062c802364fd83d43f934560149f2ddd1fee6a3 (patch) | |
tree | e5c9240b24a5b86c12b4a9481a2bd93e18b828f5 /epan/dissectors/packet-h501.c | |
parent | d4add25cb77773d9564dfc8f340ab5ce491a7d20 (diff) |
ASN.1 dissectors - don't try to find yourself.
If an ASN.1 dissector is calling register_dissector for itself in its proto_register_xxx
function and then calling find_dissector for itself in its proto_reg_handoff_xxx
function then just create a static handle for that dissector and use the return
value of register_dissector, so the find isn't necessary.
Change-Id: I911bdadc2fb4259601c141b955e741a2369cc447
Reviewed-on: https://code.wireshark.org/review/16233
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-h501.c')
-rw-r--r-- | epan/dissectors/packet-h501.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dissectors/packet-h501.c b/epan/dissectors/packet-h501.c index fd6eec9d66..0f217c7c5f 100644 --- a/epan/dissectors/packet-h501.c +++ b/epan/dissectors/packet-h501.c @@ -3675,7 +3675,7 @@ void proto_register_h501(void) { proto_register_field_array(proto_h501, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector(PFNAME, dissect_h501_pdu, proto_h501); + h501_pdu_handle = register_dissector(PFNAME, dissect_h501_pdu, proto_h501); h501_module = prefs_register_protocol(proto_h501, proto_reg_handoff_h501); prefs_register_uint_preference(h501_module, "udp.port", @@ -3703,7 +3703,6 @@ void proto_reg_handoff_h501(void) static guint saved_h501_tcp_port; if (!h501_prefs_initialized) { - h501_pdu_handle = find_dissector(PFNAME); h501_udp_handle = create_dissector_handle(dissect_h501_udp, proto_h501); h501_tcp_handle = create_dissector_handle(dissect_h501_tcp, proto_h501); h501_prefs_initialized = TRUE; |