Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp330625ybb; Thu, 28 Mar 2019 03:30:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD3OrAJQd4ynWPe/kQSd59W9SXYYnfLqaFEP2oSEMAY9h9m3atqLIKdqZvNMJdNsKC9hQw X-Received: by 2002:a17:902:728b:: with SMTP id d11mr42761762pll.257.1553769026245; Thu, 28 Mar 2019 03:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553769026; cv=none; d=google.com; s=arc-20160816; b=ucDvSjyOArfy7zE6PUF98puF44quvZxiAa6uGjoLvdMOAxXbYxDMDT16FNXOsB0Eu8 Vg9MStueXak3tqEZopSw64WG7MLpCoMY3Yo62RNlcF0UWC4W5geRJw8iyH4S7/MVaqRi WIlQ7C7G/wB3Kwt5F6HchrCcTkupnJWihJt4GtTGYy+c3X6fLoolKWrMVp5aYiQMBSP7 VKhznKuCf12BRRwHtfUrcwkwWfryGilWij4lXDG692AAbjmJ9Uri/+FAtuWpZ/pCNK3G mnYaO+D+9QlvJcRjN1pODnpbhIBZB3o5OcaHBR2WnqUoBW0b8HnCfc5UQwkIsYYabiwF KHCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=0wDBvuNSEMkpLDZDDEb8O+teRmfeH8cZe1Tg5zV128A=; b=r3JZQph7aYXoQWq6LbDtiK+j5t4MYpgZ+666iX6LNB7gSkRxwQNhACLZadZjcfCTZ3 aD2JYGYsoTK+nhojWpvJHwH1LQMej0pSTOSSlcD9P9mQ/nFC2k/ccewYCnlA2H8I0QAE puxmGHM29zVn3SsmzpyOWQkjouaaPRj36hJtbsyzTqXA2SmZFoii1BhCNBOv7u//r659 zGXBaqXVwOMM3ywuVBCEin9gGzdBnefxmgzu3rUr72e+N3Cbbkzvgv2Tao7Cr2ImuqSD 1owzEuygUI8/c/XX2Af6X5MMT8dNRRPK0K1LYshud/ArQMCa3lMCMpa08mFdjvsf/pT2 D1zA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r18si2999592pgl.530.2019.03.28.03.30.10; Thu, 28 Mar 2019 03:30:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbfC1K3b (ORCPT + 99 others); Thu, 28 Mar 2019 06:29:31 -0400 Received: from relay.sw.ru ([185.231.240.75]:36842 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbfC1K3a (ORCPT ); Thu, 28 Mar 2019 06:29:30 -0400 Received: from [10.94.4.83] (helo=finist-ce7.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1h9SHh-0005Mg-Td; Thu, 28 Mar 2019 13:29:22 +0300 From: Konstantin Khorenko To: Jarod Wilson , Jay Vosburgh Cc: Konstantin Khorenko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Veaceslav Falico , Andy Gospodarek , "David S . Miller" Subject: [PATCH] bonding: show full hw address in sysfs for slave entries Date: Thu, 28 Mar 2019 13:29:21 +0300 Message-Id: <20190328102921.11680-1-khorenko@virtuozzo.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bond expects ethernet hwaddr for its slave, but it can be longer than 6 bytes - infiniband interface for example. # cat /sys/devices//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//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 --- 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); -- 2.15.1