aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-drda.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2010-08-27 16:30:38 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2010-08-27 16:30:38 +0000
commit551093a39ace5e0d113209d09d03bfc9c7bebd93 (patch)
treeb4ef3d6747831d1b8261969351ff6bea84e10725 /epan/dissectors/packet-drda.c
parentee7d36f1dfaf29b8174ff004cec3170d4f2b5740 (diff)
From Matthieu Lochegnies via bug 5153:
Show multiples DRDA commands from the same frame. svn path=/trunk/; revision=33952
Diffstat (limited to 'epan/dissectors/packet-drda.c')
-rw-r--r--epan/dissectors/packet-drda.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c
index 21abce0b9d..a5db7217c7 100644
--- a/epan/dissectors/packet-drda.c
+++ b/epan/dissectors/packet-drda.c
@@ -666,6 +666,7 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 iCommand;
guint16 iLength;
+ guint16 iCommandEnd = 0;
guint8 iFormatFlags;
guint8 iDSSType;
@@ -685,13 +686,18 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_str(pinfo->cinfo, COL_INFO, " | ");
}
iPreviousFrameNumber = pinfo->fd->num;
- if (tvb_length(tvb) >= 10)
+ /* There may be multiple DRDA commands in one frame */
+ while ((guint) (offset + 10) <= tvb_length(tvb))
{
iCommand = tvb_get_ntohs(tvb, offset + 8);
iLength = tvb_get_ntohs(tvb, offset + 0);
+ /* iCommandEnd is the length of the packet up to the end of the current command */
+ iCommandEnd += iLength;
if (check_col(pinfo->cinfo, COL_INFO))
{
+ if (offset > 0)
+ col_append_str(pinfo->cinfo, COL_INFO, " | ");
col_append_str(pinfo->cinfo, COL_INFO, val_to_str(iCommand, drda_opcode_abbr, "Unknown (0x%02x)"));
}
@@ -729,7 +735,7 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(drda_tree, hf_drda_ddm_codepoint, tvb, offset + 8, 2, FALSE);
/* The number of attributes is variable */
- for (offset = 10; offset <= iLength; )
+ for (offset += 10; offset < iCommandEnd; )
{
if (tvb_length_remaining(tvb, offset) >= 2)
{
@@ -764,6 +770,11 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+ else
+ {
+ /* No tree, advance directly to next command */
+ offset += iLength;
+ }
}
}