]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2iscsi: Format the MAC_ADDR with sysfs_format_mac.
authorJohn Soni Jose <sony.john-n@emulex.com>
Thu, 23 Aug 2012 09:02:08 +0000 (14:32 +0530)
committerJerry Snitselaar <jerry.snitselaar@oracle.com>
Thu, 30 Aug 2012 22:34:21 +0000 (15:34 -0700)
 The MAC_ADDR stored in driver private structure is of
 unsigned char data type but strlcpy parameters is of
 signed char data type. This conversion of data types
 lead to change in the value.This changed value is passed
 to the upper layer and junk characters were displayed
 when "iscsiadm -m iface" command was run.

 In case of iSCSI boot, since the the MAC_ADDR was coming
 junk the boot was also not working

 Patch submitted to upstream kernel

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
drivers/scsi/be2iscsi/be_iscsi.c

index d950f7480f097825ab3576e8506405ad78383174..11747b44b050765b70931bac8aaea188f5b59829 100644 (file)
@@ -701,7 +701,7 @@ int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba)
        int rc;
 
        if (strlen(phba->mac_address))
-               return strlcpy(buf, phba->mac_address, PAGE_SIZE);
+               return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
 
        memset(&resp, 0, sizeof(resp));
        rc = mgmt_get_nic_conf(phba, &resp);