Skip to content

Commit

Permalink
[SCSI] be2iscsi: Format the MAC_ADDR with sysfs_format_mac.
Browse files Browse the repository at this point in the history
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 <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
John Soni Jose authored and James Bottomley committed Sep 14, 2012
1 parent 99bc5d5 commit df5d0e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/be2iscsi/be_iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit df5d0e6

Please sign in to comment.