summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-s1ap.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-06-30 20:41:45 -0400
committerAnders Broman <a.broman58@gmail.com>2016-07-01 14:26:20 +0000
commita062c802364fd83d43f934560149f2ddd1fee6a3 (patch)
treee5c9240b24a5b86c12b4a9481a2bd93e18b828f5 /epan/dissectors/packet-s1ap.c
parentd4add25cb77773d9564dfc8f340ab5ce491a7d20 (diff)
downloadwireshark-a062c802364fd83d43f934560149f2ddd1fee6a3.tar.gz
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-s1ap.c')
-rw-r--r--epan/dissectors/packet-s1ap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-s1ap.c b/epan/dissectors/packet-s1ap.c
index 93f822f5e4..0d4c0dfcc1 100644
--- a/epan/dissectors/packet-s1ap.c
+++ b/epan/dissectors/packet-s1ap.c
@@ -1366,6 +1366,8 @@ static gboolean g_s1ap_dissect_container = TRUE;
static const char *obj_id = NULL;
static dissector_handle_t gcsna_handle = NULL;
+static dissector_handle_t s1ap_handle;
+
/* Dissector tables */
static dissector_table_t s1ap_ies_dissector_table;
@@ -11811,7 +11813,7 @@ int dissect_s1ap_SONtransferCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
/*--- End of included file: packet-s1ap-fn.c ---*/
-#line 136 "./asn1/s1ap/packet-s1ap-template.c"
+#line 138 "./asn1/s1ap/packet-s1ap-template.c"
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
@@ -11886,10 +11888,8 @@ void
proto_reg_handoff_s1ap(void)
{
static gboolean Initialized=FALSE;
- static dissector_handle_t s1ap_handle;
static guint SctpPort;
- s1ap_handle = find_dissector("s1ap");
gcsna_handle = find_dissector_add_dependency("gcsna", proto_s1ap);
if (!Initialized) {
@@ -15025,7 +15025,7 @@ void proto_register_s1ap(void) {
proto_register_subtree_array(ett, array_length(ett));
/* Register dissector */
- register_dissector("s1ap", dissect_s1ap, proto_s1ap);
+ s1ap_handle = register_dissector("s1ap", dissect_s1ap, proto_s1ap);
/* Register dissector tables */
s1ap_ies_dissector_table = register_dissector_table("s1ap.ies", "S1AP-PROTOCOL-IES", proto_s1ap, FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);