From: guy Date: Tue, 29 Jul 2003 22:02:38 +0000 (+0000) Subject: From Georg von Zezschwitz: don't pass segments other than the first X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=84f614e19a8f8af02ecdd8e451fd3fa6c7260f5c;ds=sidebyside From Georg von Zezschwitz: don't pass segments other than the first segment of a segmented invoke or result to subdissectors. Show the payload of fragments other than the one that finishes reassembly. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8100 f5534014-38df-0310-8fa8-9805f1628bb7 --- diff --git a/packet-wtp.c b/packet-wtp.c index b85995d4e1..fa827279cd 100644 --- a/packet-wtp.c +++ b/packet-wtp.c @@ -2,7 +2,7 @@ * * Routines to dissect WTP component of WAP traffic. * - * $Id: packet-wtp.c,v 1.49 2003/06/30 23:24:39 guy Exp $ + * $Id: packet-wtp.c,v 1.50 2003/07/29 22:02:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -614,6 +614,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) wtp_fragment_table, psn, dataLen, !fTTR); if (fd_head != NULL) /* Reassembled */ { + /* Reassembly is complete; show the reassembled PDU */ wsp_tvb = tvb_new_real_data(fd_head->data, fd_head->len, fd_head->len); @@ -630,8 +631,11 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { + /* Reassembly isn't complete; just show the fragment */ if (check_col(pinfo->cinfo, COL_INFO)) /* Won't call WSP so display */ col_append_str(pinfo->cinfo, COL_INFO, szInfo->str); + if (tree != NULL) + proto_tree_add_text(wtp_tree, tvb, dataOffset, -1, "Payload"); } pinfo->fragmented = save_fragmented; } @@ -639,10 +643,28 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* * Normal packet, or not all the fragment data is available; - * call next dissector. + * call next dissector, unless this is a segment of a + * segmented invoke or result and isn't the first segment. */ - wsp_tvb = tvb_new_subset(tvb, dataOffset, -1, -1); - call_dissector(wsp_handle, wsp_tvb, pinfo, tree); + if ((pdut == SEGMENTED_INVOKE || pdut == SEGMENTED_RESULT) && + psn != 0) { + /* + * This is a segmented invoke or result, and not the first + * segment; just show it as a segmented invoke or result, + * don't try to dissect its payload. + */ + if (check_col(pinfo->cinfo, COL_INFO)) + col_add_fstr(pinfo->cinfo, COL_INFO, + "%s (%u)", + (pdut == SEGMENTED_INVOKE ? + "Segmented Invoke" : "Segmented Result"), + psn); + if (tree != NULL) + proto_tree_add_text(wtp_tree, tvb, dataOffset, -1, "Payload"); + } else { + wsp_tvb = tvb_new_subset(tvb, dataOffset, -1, -1); + call_dissector(wsp_handle, wsp_tvb, pinfo, tree); + } } } }