aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smb-pipe.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-03-05 07:17:50 +0000
committerGuy Harris <guy@alum.mit.edu>2003-03-05 07:17:50 +0000
commit05c41a279fb9e2df3ded86aece0470c1b1aad887 (patch)
treee20f09b7846e741997fb1b8469d5321879f09516 /packet-smb-pipe.c
parent72a00f19ca8b8d7f15a01a74916677afa42c8dfa (diff)
Use the reported length, not the captured length, as the fragment length
when doing reassembly. In some additional places, use "tvb_bytes_exist()" to check whether we have enough data to do reassembly, rather than checking to see if the frame is short (it might be short but we might still have enough data to do reassembly). In DCE RPC, use the fragment length from the header as the number of bytes of fragment data. There's no need to check "pinfo->fragmented" before doing reassembly in the DCERPC-over-SMB-pipes code - either we have all the data or we don't. In SNA and WTP reassembly, add a check to make sure we have all the data to be reassembled. svn path=/trunk/; revision=7282
Diffstat (limited to 'packet-smb-pipe.c')
-rw-r--r--packet-smb-pipe.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/packet-smb-pipe.c b/packet-smb-pipe.c
index abafeaef95..db82e60077 100644
--- a/packet-smb-pipe.c
+++ b/packet-smb-pipe.c
@@ -8,7 +8,7 @@ XXX Fixme : shouldnt show [malformed frame] for long packets
* significant rewrite to tvbuffify the dissector, Ronnie Sahlberg and
* Guy Harris 2001
*
- * $Id: packet-smb-pipe.c,v 1.88 2003/02/28 03:00:59 guy Exp $
+ * $Id: packet-smb-pipe.c,v 1.89 2003/03/05 07:17:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -3203,6 +3203,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
smb_info_t *smb_priv = (smb_info_t *)pinfo->private_data;
gboolean result;
gboolean save_fragmented;
+ guint reported_len;
dcerpc_priv.transport_type = DCERPC_TRANSPORT_SMB;
dcerpc_priv.data.smb.fid = fid;
@@ -3210,15 +3211,14 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
pinfo->private_data = &dcerpc_priv;
/*
- * Offer desegmentation service to DCERPC if this packet
- * isn't fragmented or short. Otherwise, reassembly is
- * (probably) impossible.
+ * Offer desegmentation service to DCERPC if we have all the
+ * data. Otherwise, reassembly is (probably) impossible.
*/
pinfo->can_desegment=0;
pinfo->desegment_offset = 0;
pinfo->desegment_len = 0;
- if(smb_dcerpc_reassembly && !pinfo->fragmented &&
- tvb_length(d_tvb) >= tvb_reported_length(d_tvb)){
+ reported_len = tvb_reported_length(d_tvb);
+ if(smb_dcerpc_reassembly && tvb_bytes_exist(d_tvb, 0, reported_len)){
pinfo->can_desegment=2;
}
@@ -3255,10 +3255,10 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
if(smb_dcerpc_reassembly && !pinfo->fd->flags.visited && pinfo->desegment_len){
fragment_add(d_tvb, 0, pinfo, pinfo->fd->num,
dcerpc_fragment_table,
- 0, tvb_length(d_tvb), TRUE);
+ 0, reported_len, TRUE);
fragment_set_tot_len(pinfo, pinfo->fd->num,
dcerpc_fragment_table,
- pinfo->desegment_len+tvb_length(d_tvb));
+ pinfo->desegment_len+reported_len);
/* since the other fragments are in normal ReadAndX and WriteAndX calls
we must make sure we can map FID values to this defragmentation
session */