diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2004-02-07 22:39:17 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2004-02-07 22:39:17 +0000 |
commit | a239a8feaec04ace466ba8081411370c26e42819 (patch) | |
tree | fb12d9287bfdce63df54e7616826d90f89282ef7 /sys/scsi/scsi_base.c | |
parent | 92aea805c537b999a78b6d1050189616692da82f (diff) |
If scsi_probe_bus() is called with a particular lun, ensure that lun 0
information is available to make the new lun validation logic work.
i.e. don't find phantom luns just because the user asks about them.
Also ensure the lun value given does not exceed the maximum valid lun
for a bus, rather than assuming the maximum valid lun is 7.
ok tdeval@ deraadt@.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r-- | sys/scsi/scsi_base.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 857cd0cc9ec..1c8ca024af1 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.50 2004/01/10 09:12:07 grange Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.51 2004/02/07 22:39:15 krw Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -299,9 +299,16 @@ scsi_inquire(sc_link, inqbuf, flags) { struct scsi_inquiry scsi_cmd; - bzero(&scsi_cmd, sizeof(scsi_cmd)); + bzero(&scsi_cmd, sizeof scsi_cmd); scsi_cmd.opcode = INQUIRY; - scsi_cmd.length = sizeof(struct scsi_inquiry_data); + scsi_cmd.length = sizeof *inqbuf; + + bzero(inqbuf, sizeof *inqbuf); + + memset(&inqbuf->vendor, ' ', sizeof inqbuf->vendor); + memset(&inqbuf->product, ' ', sizeof inqbuf->product); + memset(&inqbuf->revision, ' ', sizeof inqbuf->revision); + memset(&inqbuf->extra, ' ', sizeof inqbuf->extra); return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd, sizeof(scsi_cmd), (u_char *) inqbuf, |