Ethereal-dev: Re: [Ethereal-dev] Patch for Mode Sense (10) and Mode Select (10)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxxxxxx>
Date: Thu, 13 May 2004 16:56:36 -0500
Checked in.  Thanks.

Dinesh G Dutt wrote:
> Hi,
> 
> Attached is a minor bugfix for the SCSI decoder for decoding Mode Sense (10)
> and Mode Select (10) decoding. Thanks to Robert Elliott at HP for pointing out
> the problem to me. 
> 
> Dinesh
> --
> Index: packet-scsi.c
> ===================================================================
> RCS file: /cvsroot/ethereal/packet-scsi.c,v
> retrieving revision 1.36
> diff -u -r1.36 packet-scsi.c
> --- packet-scsi.c	17 Dec 2003 23:35:29 -0000	1.36
> +++ packet-scsi.c	13 May 2004 21:43:30 -0000
> @@ -2637,8 +2637,8 @@
>          desclen = tvb_get_guint8 (tvb, offset);
>          proto_tree_add_text (tree, tvb, offset, 1,
>                               "Block Descriptor Length: %u", desclen);
> -        offset += 1;
> -        payload_len -= 1;
> +        offset += 2;
> +        payload_len -= 2;
>  
>          if (!dissect_scsi_blockdescs (tvb, pinfo, tree, offset, payload_len,
>                                       desclen, devtype, longlba))
> @@ -2863,8 +2863,8 @@
>          desclen = tvb_get_guint8 (tvb, offset);
>          proto_tree_add_text (tree, tvb, offset, 1,
>                               "Block Descriptor Length: %u", desclen);
> -        offset += 1;
> -        tot_len -= 1;
> +        offset += 2;
> +        tot_len -= 2;
>  
>          if (!dissect_scsi_blockdescs (tvb, pinfo, tree, offset, tot_len,
>                                       desclen, devtype, longlba))
>