diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-16 20:06:11 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-12-31 07:31:42 +0000 |
commit | f4b0abc7296bbb431e64e31f85b24c29196c2ae4 (patch) | |
tree | 68394f5fdfa1987900f0b079d0ecfd34003e8a5a /epan/dissectors/packet-mbim.c | |
parent | 13964595ad09e5d1115f6c5cb604cded27f9f55d (diff) |
Dissectors don't need a journey of self discovery.
They already know who they are when they register themselves. Saving the
handle then to avoid finding it later.
Not sure if this will increase unnecessary register_dissector functions
(instead of using create_dissector_handle in proto_reg_handoff function)
when other dissectors copy/paste, but it should make startup time
a few microseconds better.
Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43
Reviewed-on: https://code.wireshark.org/review/19481
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-mbim.c')
-rw-r--r-- | epan/dissectors/packet-mbim.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c index b481c1ff2c..e7bae38a5c 100644 --- a/epan/dissectors/packet-mbim.c +++ b/epan/dissectors/packet-mbim.c @@ -747,6 +747,7 @@ static dissector_handle_t eth_handle; static dissector_handle_t eth_fcs_handle; static dissector_handle_t ip_handle; static dissector_handle_t data_handle; +static dissector_handle_t mbim_control_handle; static gboolean mbim_control_decode_unknown_itf = FALSE; @@ -9567,7 +9568,7 @@ proto_register_mbim(void) register_init_routine(mbim_reassembly_init); register_cleanup_routine(mbim_reassembly_cleanup); - register_dissector("mbim.control", dissect_mbim_control, proto_mbim); + mbim_control_handle = register_dissector("mbim.control", dissect_mbim_control, proto_mbim); register_dissector("mbim.descriptor", dissect_mbim_descriptor, proto_mbim); register_dissector("mbim.bulk", dissect_mbim_bulk, proto_mbim); dss_dissector_table = register_dissector_table("mbim.dss_session_id", @@ -9608,7 +9609,6 @@ proto_reg_handoff_mbim(void) initialized = TRUE; } if (mbim_control_decode_unknown_itf != mbim_control_decode_unknown_itf_prev) { - dissector_handle_t mbim_control_handle = find_dissector("mbim.control"); if (mbim_control_decode_unknown_itf) { dissector_add_uint("usb.control", IF_CLASS_UNKNOWN, mbim_control_handle); } else { |