aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dhcp-failover.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-08-09 02:41:41 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-08-09 02:41:41 +0000
commite99d4e112de2d1f266f06b6df015619bd8eda7b4 (patch)
treef1eb4716b53b18badbda7a473a519730ef035bad /epan/dissectors/packet-dhcp-failover.c
parentcd1cf557befa26e71c7fa4919f9ffbf785a25c0b (diff)
Enable the configurable port number - and make the filter name for the
protocol "dhcpfo", to match the filter names of its fields; that - or changing the long name or abbreviation of the protocol - fixes the core dump (which was in a check for a name being legal). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11631 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dhcp-failover.c')
-rw-r--r--epan/dissectors/packet-dhcp-failover.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c
index d90bc141a4..7e3b99554e 100644
--- a/epan/dissectors/packet-dhcp-failover.c
+++ b/epan/dissectors/packet-dhcp-failover.c
@@ -918,19 +918,15 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_reg_handoff_dhcpfo(void)
{
-/*
- * FIXME: I tried to make the port configurable but it just dumps core [JMayer]
- * static int initialized = FALSE;
- * static int port = 0;
- *
- * if (initialized) {
- * dissector_delete("tcp.port", port, dhcpfo_handle);
- * } else {
- * initialized = TRUE;
- * }
- * port = tcp_port_pref;
- */
+ static gboolean initialized = FALSE;
+ static unsigned int port = 0;
+ if (initialized) {
+ dissector_delete("tcp.port", port, dhcpfo_handle);
+ } else {
+ initialized = TRUE;
+ }
+ port = tcp_port_pref;
dissector_add("tcp.port", tcp_port_pref, dhcpfo_handle);
}
@@ -1159,8 +1155,8 @@ proto_register_dhcpfo(void)
module_t *dhcpfo_module;
/* Register the protocol name and description */
- proto_dhcpfo = proto_register_protocol("DHCP FAILOVER",
- "DHCP_Failover", "DHCPFAILOVER");
+ proto_dhcpfo = proto_register_protocol("DHCP Failover", "DHCPFO",
+ "dhcpfo");
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_dhcpfo, hf, array_length(hf));
@@ -1168,12 +1164,8 @@ proto_register_dhcpfo(void)
dhcpfo_handle = create_dissector_handle(dissect_dhcpfo, proto_dhcpfo);
-/*
- * FIXME: I tried to make the port configurable but it just dumps core [JMayer]
- * dhcpfo_module = prefs_register_protocol(proto_dhcpfo, proto_reg_handoff_dhcpfo);
- * prefs_register_uint_preference(dhcpfo_module, "tcp.port",
- * "DHCPFO TCP Port", "Set the port for DHCP failover communications if other than default of TCP_PORT_DHCPFO",
- * 10, &tcp_port_pref);
- */
+ dhcpfo_module = prefs_register_protocol(proto_dhcpfo, proto_reg_handoff_dhcpfo);
+ prefs_register_uint_preference(dhcpfo_module, "tcp_port",
+ "DHCPFO TCP Port", "Set the port for DHCP failover communications if other than default of TCP_PORT_DHCPFO",
+ 10, &tcp_port_pref);
}
-