diff -u ipmitool-1.8.13/debian/changelog ipmitool-1.8.13/debian/changelog --- ipmitool-1.8.13/debian/changelog +++ ipmitool-1.8.13/debian/changelog @@ -1,3 +1,12 @@ +ipmitool (1.8.13-1ubuntu0.6) trusty; urgency=medium + + * debian/patches/lp1509896_fix_scsi_probe_607cfe6.patch: allow for up to + 16 devices on the SCSI bus when probing. Fixes the probing failing the + use of the USB transport for IPMI when there are more than 8 SCSI devices + on the bus, and follows the max devices for SCSI-3. (LP: #1509896) + + -- Mathieu Trudel-Lapierre Wed, 04 Nov 2015 17:36:22 -0600 + ipmitool (1.8.13-1ubuntu0.5) trusty; urgency=medium * debian/patches/usb_interface_support.patch: include bswap.h from hpm2.h; diff -u ipmitool-1.8.13/debian/patches/series ipmitool-1.8.13/debian/patches/series --- ipmitool-1.8.13/debian/patches/series +++ ipmitool-1.8.13/debian/patches/series @@ -7,0 +8 @@ +lp1509896_fix_scsi_probe_607cfe6.patch only in patch2: unchanged: --- ipmitool-1.8.13.orig/debian/patches/lp1509896_fix_scsi_probe_607cfe6.patch +++ ipmitool-1.8.13/debian/patches/lp1509896_fix_scsi_probe_607cfe6.patch @@ -0,0 +1,79 @@ +commit 607cfe6f4776093ad72fa3149318cf8ce8124bef +Author: Jeremy Kerr +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ipmitool/+bug/1509896 +Subject: plugins/usb: Fix probe for SCSI devices + + ID:394 - plugins/usb: Fix probe for SCSI devices + + The current USB plugin doesn't find my IPMI channel: + + # ipmitool -I usb mc info + Error in USB session setup + + Unable to setup interface usb + Error loading interface usb + + This is beacuse I have more than 8 scsi-generic devices that identify + as AMI: + + # grep -c ^AMI /proc/scsi/sg/device_strs + 13 + + So we end up hitting the max in FindG2CDROM, and abort without finding + the actual IPMI endpoint (on my system, this is /dev/sg11). + + This change bumps that maximum up to 16. + + However, that means we hit another bug in scsiProbeNew, where if + we hit the end of the file without completely filling the array, + we return with an error. This change handles the EOF condition + gracefully instead. + + Also, fp is never going to become NULL; we don't need to check for that + condition. + + Signed-off-by: Jeremy Kerr + +--- + src/plugins/usb/usb.c | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +Index: b/src/plugins/usb/usb.c +=================================================================== +--- a/src/plugins/usb/usb.c ++++ b/src/plugins/usb/usb.c +@@ -135,11 +135,7 @@ scsiProbeNew(int* num_ami_devices, int* + while(1) { + /* Read line by line and search for "AMI" */ + if(fgets(linebuf, 80, fp) == NULL) { +- if(fp != NULL) { +- fclose(fp); +- } +- /* Return 1 on error */ +- return 1; ++ break; + } + + if(sscanf(linebuf, "%s", vendor) == 1) { +@@ -156,9 +152,7 @@ scsiProbeNew(int* num_ami_devices, int* + } + + *num_ami_devices = numdevfound; +- if(fp != NULL) { +- fclose(fp); +- } ++ fclose(fp); + + return 0; + } +@@ -270,8 +264,8 @@ FindG2CDROM(struct ipmi_intf *intf) + { + int err = 0; + char device[256]; +- int devarray[8]; +- int numdev = 8; ++ int devarray[16]; ++ int numdev = 16; + int iter; + err = scsiProbeNew(&numdev,devarray); +