From: John Soni Jose Date: Mon, 20 Aug 2012 17:30:31 +0000 (+0530) Subject: [SCSI] be2iscsi: Format the MAC_ADDR with sysfs_format_mac. X-Git-Tag: next-20120917~76^2~2^2~9 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=df5d0e6ee9d68f874959fa028388efa26f495f63;p=karo-tx-linux.git [SCSI] be2iscsi: Format the MAC_ADDR with sysfs_format_mac. 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 Signed-off-by: John Soni Jose Signed-off-by: Jayamohan Kallickal Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c index 41b1fb70dd3b..8efdd8e2d989 100644 --- a/drivers/scsi/be2iscsi/be_iscsi.c +++ b/drivers/scsi/be2iscsi/be_iscsi.c @@ -792,7 +792,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);