diff options
author | Bill Meier <wmeier@newsguy.com> | 2008-09-15 15:38:34 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2008-09-15 15:38:34 +0000 |
commit | 1e7e3cee51ac00f1a54c9c40f9adc90d82987a62 (patch) | |
tree | 77bae77432f83538696326024eddbba8e87ac5bc /epan/dissectors/packet-dhcp-failover.c | |
parent | 2aee2b22f6a655c1a2fb957216ba6e0cd695eaac (diff) | |
download | wireshark-1e7e3cee51ac00f1a54c9c40f9adc90d82987a62.tar.gz |
Minor cleanup related to proto_reg_handoff
svn path=/trunk/; revision=26196
Diffstat (limited to 'epan/dissectors/packet-dhcp-failover.c')
-rw-r--r-- | epan/dissectors/packet-dhcp-failover.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c index e478eac129..8e05618622 100644 --- a/epan/dissectors/packet-dhcp-failover.c +++ b/epan/dissectors/packet-dhcp-failover.c @@ -53,13 +53,11 @@ #define TCP_PORT_DHCPFO 519 -static unsigned int tcp_port_pref = TCP_PORT_DHCPFO; +static guint tcp_port_pref = TCP_PORT_DHCPFO; /* desegmentation of DHCP failover over TCP */ static gboolean dhcpfo_desegment = TRUE; -static dissector_handle_t dhcpfo_handle; - /* Initialize the protocol and registered fields */ static int proto_dhcpfo = -1; static int hf_dhcpfo_length = -1; @@ -958,15 +956,17 @@ void proto_reg_handoff_dhcpfo(void) { static gboolean initialized = FALSE; - static unsigned int port = 0; + static dissector_handle_t dhcpfo_handle; + static guint saved_tcp_port; - if (initialized) { - dissector_delete("tcp.port", port, dhcpfo_handle); - } else { + if (!initialized) { + dhcpfo_handle = create_dissector_handle(dissect_dhcpfo, proto_dhcpfo); initialized = TRUE; + } else { + dissector_delete("tcp.port", saved_tcp_port, dhcpfo_handle); } - port = tcp_port_pref; dissector_add("tcp.port", tcp_port_pref, dhcpfo_handle); + saved_tcp_port = tcp_port_pref; } /* Register the protocol with Wireshark */ @@ -1201,8 +1201,6 @@ proto_register_dhcpfo(void) proto_register_field_array(proto_dhcpfo, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - dhcpfo_handle = create_dissector_handle(dissect_dhcpfo, proto_dhcpfo); - dhcpfo_module = prefs_register_protocol(proto_dhcpfo, proto_reg_handoff_dhcpfo); prefs_register_uint_preference(dhcpfo_module, "tcp_port", "DHCP failover TCP Port", "Set the port for DHCP failover communications", |