diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-01-13 02:16:04 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-01-13 11:36:29 +0000 |
commit | bf0f5a982bc0666b6fa8d70c8d64cb1f07ab12ad (patch) | |
tree | 1a6adb34aa0b0b7b59e5f1f2fedfda9014e9769d /epan/dissectors/packet-dhcpv6.c | |
parent | 4f4769adf626ec2601e3488efbc2e2d57d55762c (diff) | |
download | wireshark-bf0f5a982bc0666b6fa8d70c8d64cb1f07ab12ad.tar.gz |
Use result of register_dissector
Assign result of `register_dissector(..., func, proto)` to FOO_handle
and remove `FOO_handle = create_dissector_handle(func, proto)`.
Found by looking for files named packet-FOO.c having the above
create_dissector_handle pattern. Some files (with different dissect
routines for the two functions) remain unchanged.
Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90
Reviewed-on: https://code.wireshark.org/review/13247
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: 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-dhcpv6.c')
-rw-r--r-- | epan/dissectors/packet-dhcpv6.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 65349a99d4..9f740414b9 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -226,6 +226,8 @@ static expert_field ei_dhcpv6_bulk_leasequery_bad_query_type = EI_INIT; static expert_field ei_dhcpv6_bulk_leasequery_no_lq_relay_data = EI_INIT; static expert_field ei_dhcpv6_bulk_leasequery_bad_msg_type = EI_INIT; +static dissector_handle_t dhcpv6_handle; + #define UDP_PORT_DHCPV6_DOWNSTREAM 546 #define UDP_PORT_DHCPV6_UPSTREAM 547 @@ -2398,7 +2400,7 @@ proto_register_dhcpv6(void) expert_register_field_array(expert_dhcpv6_bulk_leasequery, ei_bulk_leasequery, array_length(ei_bulk_leasequery)); /* Allow other dissectors to find this one by name. */ - register_dissector("dhcpv6", dissect_dhcpv6_stream, proto_dhcpv6); + dhcpv6_handle = register_dissector("dhcpv6", dissect_dhcpv6_stream, proto_dhcpv6); dhcpv6_module = prefs_register_protocol(proto_dhcpv6, NULL); prefs_register_bool_preference(dhcpv6_module, "cablelabs_interface_id", @@ -2416,9 +2418,8 @@ proto_register_dhcpv6(void) void proto_reg_handoff_dhcpv6(void) { - dissector_handle_t dhcpv6_handle, dhcpv6_bulkquery_handle; + dissector_handle_t dhcpv6_bulkquery_handle; - dhcpv6_handle = create_dissector_handle(dissect_dhcpv6_stream, proto_dhcpv6); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_DOWNSTREAM, dhcpv6_handle); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_UPSTREAM, dhcpv6_handle); |