summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-ipv6.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-12-16 20:06:11 -0500
committerAnders Broman <a.broman58@gmail.com>2016-12-31 07:31:42 +0000
commitf4b0abc7296bbb431e64e31f85b24c29196c2ae4 (patch)
tree68394f5fdfa1987900f0b079d0ecfd34003e8a5a /epan/dissectors/packet-ipv6.c
parent13964595ad09e5d1115f6c5cb604cded27f9f55d (diff)
downloadwireshark-f4b0abc7296bbb431e64e31f85b24c29196c2ae4.tar.gz
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-ipv6.c')
-rw-r--r--epan/dissectors/packet-ipv6.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c
index a2a4b301e2..d8cb5210a2 100644
--- a/epan/dissectors/packet-ipv6.c
+++ b/epan/dissectors/packet-ipv6.c
@@ -338,6 +338,7 @@ static expert_field ei_ipv6_bogus_ipv6_version = EI_INIT;
static expert_field ei_ipv6_invalid_header = EI_INIT;
static expert_field ei_ipv6_opt_header_mismatch = EI_INIT;
+static dissector_handle_t ipv6_handle;
#define set_address_ipv6(dst, src_ip6) \
set_address((dst), AT_IPv6, IPv6_ADDR_SIZE, (src_ip6))
@@ -3518,7 +3519,7 @@ proto_register_ipv6(void)
"If enabled the Length field in octets will be hidden",
&ipv6_exthdr_hide_len_oct_field);
- register_dissector("ipv6", dissect_ipv6, proto_ipv6);
+ ipv6_handle = register_dissector("ipv6", dissect_ipv6, proto_ipv6);
register_init_routine(ipv6_reassemble_init);
register_cleanup_routine(ipv6_reassemble_cleanup);
ip6_hdr_tap = register_tap("ipv6");
@@ -3539,7 +3540,6 @@ proto_register_ipv6(void)
void
proto_reg_handoff_ipv6(void)
{
- dissector_handle_t ipv6_handle;
dissector_handle_t ipv6_hopopts_handle;
dissector_handle_t ipv6_routing_handle;
dissector_handle_t ipv6_fraghdr_handle;
@@ -3547,7 +3547,6 @@ proto_reg_handoff_ipv6(void)
capture_dissector_handle_t ipv6_cap_handle;
capture_dissector_handle_t ipv6_ext_cap_handle;
- ipv6_handle = find_dissector("ipv6");
dissector_add_uint("ethertype", ETHERTYPE_IPv6, ipv6_handle);
dissector_add_uint("erf.types.type", ERF_TYPE_IPV6, ipv6_handle);
dissector_add_uint("ppp.protocol", PPP_IPV6, ipv6_handle);