Skip to content

Commit 18bebc6

Browse files
finist0davem330
authored andcommitted
bonding: show full hw address in sysfs for slave entries
Bond expects ethernet hwaddr for its slave, but it can be longer than 6 bytes - infiniband interface for example. # cat /sys/devices/<skipped>/net/ib0/address 80:00:02:08:fe:80:00:00:00:00:00:00:7c:fe:90:03:00:be:5d:e1 # cat /sys/devices/<skipped>/net/ib0/bonding_slave/perm_hwaddr 80:00:02:08:fe:80 So print full hwaddr in sysfs "bonding_slave/perm_hwaddr" as well. Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9a5a90d commit 18bebc6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/bonding/bond_sysfs_slave.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ static SLAVE_ATTR_RO(link_failure_count);
5555

5656
static ssize_t perm_hwaddr_show(struct slave *slave, char *buf)
5757
{
58-
return sprintf(buf, "%pM\n", slave->perm_hwaddr);
58+
return sprintf(buf, "%*phC\n",
59+
slave->dev->addr_len,
60+
slave->perm_hwaddr);
5961
}
6062
static SLAVE_ATTR_RO(perm_hwaddr);
6163

0 commit comments

Comments
 (0)