diff options
author | mav <mav@FreeBSD.org> | 2014-08-17 18:26:34 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-08-17 18:26:34 +0000 |
commit | e13575583f1eeb0dbfa5eb4e0d2f5d039a1d5913 (patch) | |
tree | 6c095bf0923d5dda7285f5a9f11aca3477790544 | |
parent | b70f4cf9fc392c39962fcebd40ebe7ca804b1e70 (diff) | |
download | FreeBSD-src-e13575583f1eeb0dbfa5eb4e0d2f5d039a1d5913.zip FreeBSD-src-e13575583f1eeb0dbfa5eb4e0d2f5d039a1d5913.tar.gz |
MFC r269631:
Reduce reported additional INQUIRY data length.
sizeof(struct scsi_inquiry_data) of 256 bytes combined with off-by-one
error in the changed code gave total INQUIRY data length above 255 bytes,
that was maximal INQUIRY length in SPC-2. While SPC-3 increased the
maximal length to 64K, at least sg3_utils are still confused by that.
-rw-r--r-- | sys/cam/ctl/ctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index e7d1e3e..b6531e7 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -10464,7 +10464,9 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio) */ inq_ptr->response_format = SID_HiSup | 2; - inq_ptr->additional_length = sizeof(*inq_ptr) - 4; + inq_ptr->additional_length = + offsetof(struct scsi_inquiry_data, vendor_specific1) - + (offsetof(struct scsi_inquiry_data, additional_length) + 1); CTL_DEBUG_PRINT(("additional_length = %d\n", inq_ptr->additional_length)); |