diff options
author | mav <mav@FreeBSD.org> | 2013-12-22 13:02:34 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-12-22 13:02:34 +0000 |
commit | 53624fa2936c1954c057223f84395432a0f23483 (patch) | |
tree | d9207ab7750ea00ea6e5b024eb47d2659a548036 /sys/cam | |
parent | 68205669abdad29d13f7e6b34f483ac1298065ed (diff) | |
download | FreeBSD-src-53624fa2936c1954c057223f84395432a0f23483.zip FreeBSD-src-53624fa2936c1954c057223f84395432a0f23483.tar.gz |
MFC r259108:
When comparing device IDs, make sure that they have the same type
(like NAA assigned) and identify the same entity (like device or port).
Otherwise there can be false positives since at least some models of
Seagate disks use same IDs for the whole device and one of its ports.
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_all.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 1d4d77e..ff9dc17 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -6509,7 +6509,11 @@ scsi_devid_match(uint8_t *lhs, size_t lhs_len, uint8_t *rhs, size_t rhs_len) while (rhs_id <= rhs_last && (rhs_id->identifier + rhs_id->length) <= rhs_end) { - if (rhs_id->length == lhs_id->length + if ((rhs_id->id_type & + (SVPD_ID_ASSOC_MASK | SVPD_ID_TYPE_MASK)) == + (lhs_id->id_type & + (SVPD_ID_ASSOC_MASK | SVPD_ID_TYPE_MASK)) + && rhs_id->length == lhs_id->length && memcmp(rhs_id->identifier, lhs_id->identifier, rhs_id->length) == 0) return (0); |