From d8aa05d9721062c5d7ee6fa22d937ed4cf50db04 Mon Sep 17 00:00:00 2001 From: asomers Date: Wed, 15 May 2013 17:26:50 +0000 Subject: sbin/camcontrol/camcontrol.c If an expander returns 0x00 (no device attached) in the ATTACHED DEVICE field of the SMP DISCOVER response, ignore the value of ATTACHED SAS ADDRESS, because it is invalid. Some expanders zero out the address when the attached device is removed, but others do not. Section 9.4.3.10 of the SAS Protocol Layer 2 revision 04b does not require them to do so. Approved by: ken (mentor) MFC after: 3 weeks --- sbin/camcontrol/camcontrol.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 7f13520..7a374a4 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -7138,8 +7138,12 @@ smpphylist(struct cam_device *device, int argc, char **argv, continue; } - item = findsasdevice(&devlist, - scsi_8btou64(disresponse->attached_sas_address)); + if (disresponse->attached_device == SMP_DIS_AD_TYPE_NONE) { + item = NULL; + } else { + item = findsasdevice(&devlist, + scsi_8btou64(disresponse->attached_sas_address)); + } if ((quiet == 0) || (item != NULL)) { -- cgit v1.1