summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorKonstantin Khorenko <khorenko@virtuozzo.com>2019-03-28 13:29:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 09:17:19 +0200
commitc452e33d4940eda5f7f9e173cbc9356de6aedc66 (patch)
tree00061b80fde386ace9c3d87f47866a5a15cebb5b /drivers/net
parentb2eed39466f8faca272f89fbfdf47f7a67a4b8f1 (diff)
downloadlinux-stable-c452e33d4940eda5f7f9e173cbc9356de6aedc66.tar.gz
linux-stable-c452e33d4940eda5f7f9e173cbc9356de6aedc66.tar.bz2
linux-stable-c452e33d4940eda5f7f9e173cbc9356de6aedc66.zip
bonding: show full hw address in sysfs for slave entries
[ Upstream commit 18bebc6dd3281955240062655a4df35eef2c46b3 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_sysfs_slave.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
index b01b0ce4d1be..cf9e9a3d4a48 100644
--- a/drivers/net/bonding/bond_sysfs_slave.c
+++ b/drivers/net/bonding/bond_sysfs_slave.c
@@ -55,7 +55,9 @@ static SLAVE_ATTR_RO(link_failure_count);
static ssize_t perm_hwaddr_show(struct slave *slave, char *buf)
{
- return sprintf(buf, "%pM\n", slave->perm_hwaddr);
+ return sprintf(buf, "%*phC\n",
+ slave->dev->addr_len,
+ slave->perm_hwaddr);
}
static SLAVE_ATTR_RO(perm_hwaddr);