Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Patch to fix broken compilation

From: Florent Drouin <florent.drouin@xxxxxxxxxxxxxxxxx>
Date: Wed, 25 Jul 2007 10:00:37 +0200
   Hi,

Could someone apply the following patchs in plugins/profinet/packet-dcerpc-pn-io.c and plugins/wimax/mac_hd_generic_decoder.c
I have got some errors during compilation, and the Unix buildbot is red.

packet-dcerpc-pn-io.c: In function `dissect_PDIRFrameData_block':
packet-dcerpc-pn-io.c:3467: warning: unused parameter `item'
make[3]: *** [packet-dcerpc-pn-io.lo] Error 1

In /plugins/profinet/packet-dcerpc-pn-io.c
Add a "_U_" after proto_item *item in dissect_PDIRFrameData_block

<<
diff -u packet-dcerpc-pn-io.c.ori packet-dcerpc-pn-io.c --- packet-dcerpc-pn-io.c.ori 2007-07-25 09:30:48.000000000 +0200
+++ packet-dcerpc-pn-io.c       2007-07-25 09:39:30.000000000 +0200
@@ -3464,7 +3464,7 @@
/* dissect the PDIRFrameData block */
static int
dissect_PDIRFrameData_block(tvbuff_t *tvb, int offset,
- packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint16 u16BodyLength) + packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint16 u16BodyLength)
{
    guint32 u32FrameSendOffset;
    guint16 u16DataLength;
>>

generic_decoder.c  -fPIC -DPIC -o .libs/mac_hd_generic_decoder.o
mac_hd_generic_decoder.c: In function `dissect_mac_header_generic_decoder':
mac_hd_generic_decoder.c:1493: warning: `payload_length' might be used uninitialized in this function mac_hd_generic_decoder.c:1502: warning: `new_payload_len' might be used uninitialized in this function
make[3]: *** [mac_hd_generic_decoder.lo] Error 1

In plugins/wimax/mac_hd_generic_decoder.c
Initialize payload_length=0 and new_payload_len=0 in dissect_mac_header_generic_decoder

<<
diff -u mac_hd_generic_decoder.c.ori mac_hd_generic_decoder.c --- mac_hd_generic_decoder.c.ori 2007-07-25 09:41:57.000000000 +0200
+++ mac_hd_generic_decoder.c    2007-07-25 09:47:50.000000000 +0200
@@ -1490,7 +1490,7 @@
void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
       guint offset = 0;
-       guint payload_offset, payload_length;
+       guint payload_offset, payload_length=0;

       static guint8 frag_number[MAX_CID];
       static guint cid_list[MAX_CID];
@@ -1499,7 +1499,7 @@
       static char *data_str = "Data transport PDU (%u bytes)";
       char *str_ptr;
       gint length, i, cid_index;
-       guint tvb_len, ret_length, ubyte, new_tvb_len, new_payload_len;
+       guint tvb_len, ret_length, ubyte, new_tvb_len, new_payload_len=0;
guint mac_ht, mac_ec, mac_esf, mac_ci, mac_eks, mac_len, mac_cid, cid; guint ffb_grant_mgmt_subheader, packing_subheader, fragment_subheader;
       guint mesh_subheader;
>>

Regards
Florent