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-lcsap.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-lcsap.c')
-rw-r--r-- | epan/dissectors/packet-lcsap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-lcsap.c b/epan/dissectors/packet-lcsap.c index 9149a282da..41bf546c1c 100644 --- a/epan/dissectors/packet-lcsap.c +++ b/epan/dissectors/packet-lcsap.c @@ -297,6 +297,8 @@ static guint32 ProtocolExtensionID; static guint32 PayloadType = -1; static guint gbl_lcsapSctpPort=SCTP_PORT_LCSAP; +static dissector_handle_t lcsap_handle; + /* Dissector tables */ static dissector_table_t lcsap_ies_dissector_table; @@ -2229,7 +2231,7 @@ static int dissect_LCS_AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro /*--- End of included file: packet-lcsap-fn.c ---*/ -#line 190 "./asn1/lcsap/packet-lcsap-template.c" +#line 192 "./asn1/lcsap/packet-lcsap-template.c" static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { @@ -2280,11 +2282,9 @@ void proto_reg_handoff_lcsap(void) { static gboolean Initialized=FALSE; - static dissector_handle_t lcsap_handle; static guint SctpPort; if (!Initialized) { - lcsap_handle = find_dissector("lcsap"); lpp_handle = find_dissector_add_dependency("lpp", proto_lcsap); lppa_handle = find_dissector_add_dependency("lppa", proto_lcsap); dissector_add_for_decode_as("sctp.port", lcsap_handle); /* for "decode-as" */ @@ -2880,7 +2880,7 @@ void proto_register_lcsap(void) { /* Register fields and subtrees */ proto_register_field_array(proto_lcsap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("lcsap", dissect_lcsap, proto_lcsap); + lcsap_handle = register_dissector("lcsap", dissect_lcsap, proto_lcsap); /* Register dissector tables */ lcsap_ies_dissector_table = register_dissector_table("lcsap.ies", "LCS-AP-PROTOCOL-IES", proto_lcsap, FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE); |