lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4734.1553892205@famine>
Date:   Fri, 29 Mar 2019 13:43:25 -0700
From:   Jay Vosburgh <jay.vosburgh@...onical.com>
To:     Konstantin Khorenko <khorenko@...tuozzo.com>
cc:     Jarod Wilson <jarod@...hat.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Veaceslav Falico <vfalico@...il.com>,
        Andy Gospodarek <andy@...yhouse.net>,
        "David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH] bonding: show full hw address in sysfs for slave entries

Konstantin Khorenko <khorenko@...tuozzo.com> wrote:

>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@...tuozzo.com>
>---
> drivers/net/bonding/bond_sysfs_slave.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
>index 2f120b2ffef0..4985268e2273 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);

Acked-by: Jay Vosburgh <jay.vosburgh@...onical.com>

	-J

---
	-Jay Vosburgh, jay.vosburgh@...onical.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ