aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rsvd.c
diff options
context:
space:
mode:
authorVolodymyr Khomenko <Volodymyr_Khomenko@DellTeam.com>2017-01-13 15:54:51 +0200
committerAnders Broman <a.broman58@gmail.com>2017-01-16 16:05:59 +0000
commit93df6be934268548600fe497d20ed16ac40008df (patch)
treed72e484e0edd14b5d68c1fa8a8fc8216bfa9b493 /epan/dissectors/packet-rsvd.c
parentfb0d51aa66a38b5ef133183978571957ba506393 (diff)
RSVD: fix TUNNEL_SCSI_REQUEST
Length of CDBBuffer must be always 16 bytes If CDBLength is less than 16, add padding bytes Change-Id: I241a10325ebe17b32469eaf7dc530fc7fe2105de Reviewed-on: https://code.wireshark.org/review/19628 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-rsvd.c')
-rw-r--r--epan/dissectors/packet-rsvd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/epan/dissectors/packet-rsvd.c b/epan/dissectors/packet-rsvd.c
index 64507234b1..d948315c50 100644
--- a/epan/dissectors/packet-rsvd.c
+++ b/epan/dissectors/packet-rsvd.c
@@ -51,6 +51,7 @@ static int hf_svhdx_tunnel_scsi_srb_flags = -1;
static int hf_svhdx_tunnel_scsi_data_transfer_length = -1;
static int hf_svhdx_tunnel_scsi_reserved3 = -1;
static int hf_svhdx_tunnel_scsi_cdb = -1;
+static int hf_svhdx_tunnel_scsi_cdb_padding = -1;
static int hf_svhdx_tunnel_scsi_data = -1;
static int hf_svhdx_tunnel_scsi_auto_generated_sense = -1;
static int hf_svhdx_tunnel_scsi_srb_status = -1;
@@ -264,6 +265,15 @@ dissect_RSVD_TUNNEL_SCSI(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pare
tvb_reported_length_remaining(tvb, offset));
proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_cdb, tvb, offset, cdb_length, ENC_NA);
offset += cdb_length;
+ if (cdb_length < 16) {
+ /*
+ * CDBBuffer is always 16 bytes - see https://msdn.microsoft.com/en-us/library/dn393496.aspx
+ * If CDB is actually smaller, we need to define padding bytes
+ */
+ guint32 cdb_padding_length = 16 - cdb_length;
+ proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_cdb_padding, tvb, offset, cdb_padding_length, ENC_NA);
+ offset += cdb_padding_length;
+ }
/* Reserved3 */
proto_tree_add_item(sub_tree, hf_svhdx_tunnel_scsi_reserved3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
@@ -701,6 +711,10 @@ proto_register_rsvd(void)
{ "CDB", "rsvd.svhdx_scsi_cdb", FT_BYTES, BASE_NONE,
NULL, 0, NULL, HFILL }},
+ { &hf_svhdx_tunnel_scsi_cdb_padding,
+ { "CDBPadding", "rsvd.svhdx_scsi_cdb_padding", FT_BYTES, BASE_NONE,
+ NULL, 0, NULL, HFILL }},
+
{ &hf_svhdx_tunnel_scsi_data,
{"Data", "rsvd.svhdx_scsi_data", FT_BYTES, BASE_NONE,
NULL, 0, NULL, HFILL }},