Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 40853: /trunk/epan/dissectors/ /trun

From: "Maynard, Chris" <Christopher.Maynard@xxxxxxxxx>
Date: Tue, 7 Feb 2012 12:11:31 -0500
> -----Original Message-----
> From: wireshark-commits-bounces@xxxxxxxxxxxxx [mailto:wireshark-
> commits-bounces@xxxxxxxxxxxxx] On Behalf Of jmayer@xxxxxxxxxxxxx
> Sent: Sunday, February 05, 2012 6:24 AM
> To: wireshark-commits@xxxxxxxxxxxxx
> Subject: [Wireshark-commits] rev 40853: /trunk/epan/dissectors/
> /trunk/epan/dissectors/: packet-dvb-ipdc.c
> 
> http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=40853
> 
> User: jmayer
> Date: 2012/02/05 03:24 AM
> 
> Log:
>  There is a logic bug in this dissector that is exposed
>  by a set but unused warning. Hack around this for now.
>  Someone who knows the protocol should fix this.
> 
> Directory: /trunk/epan/dissectors/
>   Changes    Path                 Action
>   +5 -5      packet-dvb-ipdc.c    Modified
> 

Perhaps the attached patch (with additional whitespace cleanup) is what was intended?
- Chris

-- 

Index: epan/dissectors/packet-dvb-ipdc.c
===================================================================
--- epan/dissectors/packet-dvb-ipdc.c	(revision 40918)
+++ epan/dissectors/packet-dvb-ipdc.c	(working copy)
@@ -42,8 +42,8 @@
 
 
 enum {
-	SUB_FLUTE,
-	SUB_MAX,
+    SUB_FLUTE,
+    SUB_MAX,
 };
 
 static dissector_handle_t sub_handles[SUB_MAX];
@@ -55,64 +55,58 @@
 static void
 dissect_ipdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
-	tvbuff_t *next_tvb;
-	guint16 len;
+    tvbuff_t *next_tvb;
+    guint16 len;
+    proto_tree *esg_tree = NULL;
 
-	col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPDC");
-	col_clear(pinfo->cinfo, COL_INFO);
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPDC");
+    col_clear(pinfo->cinfo, COL_INFO);
 
-	/* call into flute */
-	len = tvb_reported_length_remaining(tvb, 0);
+    /* call into flute */
+    len = tvb_reported_length_remaining(tvb, 0);
 
-/* FIXME: make proper use of esg_tree, everythign else is a logic bug */
-	if (tree) {
-		/* proto_item *ti; */
-		/* proto_tree *esg_tree; */
+    if (tree) {
+        proto_item *ti;
 
-		/* ti = */ proto_tree_add_protocol_format(tree, proto_ipdc,
-				tvb, 0, len,
-				"ESG Bootstrap");
-		/* esg_tree = proto_item_add_subtree(ti, ett_ipdc); */
-	}
+        ti = proto_tree_add_protocol_format(tree, proto_ipdc, tvb, 0, len,
+            "ESG Bootstrap");
+        esg_tree = proto_item_add_subtree(ti, ett_ipdc);
+    }
 
-	next_tvb = tvb_new_subset(tvb, 0, len, len);
-	call_dissector(sub_handles[SUB_FLUTE], next_tvb, pinfo, tree);
+    next_tvb = tvb_new_subset(tvb, 0, len, len);
+    call_dissector(sub_handles[SUB_FLUTE], next_tvb, pinfo, esg_tree);
 }
 
 void
 proto_register_dvb_ipdc(void)
 {
-	static hf_register_info hf[] = {
-		{&hf_ipdc_esg_bootstrap_xml,
-		 {"ESG Provider Discovery", "ipdc.bootstrap",
-		  FT_STRING, BASE_NONE, NULL, 0x0,
-		  "List of ESG Providers", HFILL}
-		},
-	};
+    static hf_register_info hf[] = {
+        {&hf_ipdc_esg_bootstrap_xml,
+            {"ESG Provider Discovery", "ipdc.bootstrap",
+            FT_STRING, BASE_NONE, NULL, 0x0, "List of ESG Providers", HFILL}}
+    };
 
-	static gint *ett[] = {
-		&ett_ipdc,
-	};
+    static gint *ett[] = {
+        &ett_ipdc,
+    };
 
-	proto_ipdc =
-	    proto_register_protocol("ETSI IPDC Bootstrap",
-				    "ESG Bootstrap", "dvb_ipdc");
-	proto_register_field_array(proto_ipdc, hf, array_length(hf));
-	proto_register_subtree_array(ett, array_length(ett));
+    proto_ipdc = proto_register_protocol("ETSI IPDC Bootstrap",
+        "ESG Bootstrap", "dvb_ipdc");
+    proto_register_field_array(proto_ipdc, hf, array_length(hf));
+    proto_register_subtree_array(ett, array_length(ett));
 
-	register_dissector("dvb_ipdc", dissect_ipdc, proto_ipdc);
+    register_dissector("dvb_ipdc", dissect_ipdc, proto_ipdc);
 }
 
 void
 proto_reg_handoff_dvb_ipdc(void)
 {
-	dissector_handle_t ipdc_handle;
+    dissector_handle_t ipdc_handle;
 
-	sub_handles[SUB_FLUTE] = find_dissector("alc");
+    sub_handles[SUB_FLUTE] = find_dissector("alc");
 
-	ipdc_handle = create_dissector_handle(dissect_ipdc, proto_ipdc);
-	dissector_add_uint("udp.port", UDP_PORT_IPDC_ESG_BOOTSTRAP, ipdc_handle);
-
+    ipdc_handle = create_dissector_handle(dissect_ipdc, proto_ipdc);
+    dissector_add_uint("udp.port", UDP_PORT_IPDC_ESG_BOOTSTRAP, ipdc_handle);
 }
 
 /*
CONFIDENTIALITY NOTICE: The information contained in this email message is intended only for use of the intended recipient. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately delete it from your system and notify the sender by replying to this email.  Thank you.