Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2535552yba; Mon, 6 May 2019 07:38:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAjhYkCWJxDAvLwAoCkDAxLWf0Yqne6WzeGtcwfOYnWV8VRRyfJbntgu8NslNQcNP2v7LG X-Received: by 2002:a62:62c1:: with SMTP id w184mr9744280pfb.95.1557153536379; Mon, 06 May 2019 07:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153536; cv=none; d=google.com; s=arc-20160816; b=alWCtIuozUBaPeKI9FNqzkkgbLNKYl23G/jwaBiOHXM6KX1yZtlRiKvrC5rqk6x26u J3e5NSWbFrARw30fFeNNfcU2HAUP0yR/hy52nAA/jJcWXzdnZ2aDZCpN+DUJ+lztoBZG WM6mLFPmt+kqVXE6BXnMJXONapnPk9yli89/us8OEraKx0gSxzxNp4SrbtrTi0/0Sadu Sk8/0Aor5H/DzuHIv+K3Cfup5le5HFvW75o5WE0JUJ0q5FYghLy23boQ59FfGDxIDo9E gE464J8yWu8mEtAJdh9dXqAtLiNt2gP03/zlt4TlYT0Iej9uOlJpnhY9705U9JusXd+w BLJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EXyRk6IX04vWzX+G5PG2H7RBXY5CNn0XqhGAg4b4F4E=; b=CSI+CwriQX/vrYDLZZGIL8vQt5LQmM+GGHP4er5qFX8rx+29xZpZcbRS7JpLu2YxF1 2gmerZG5GPTVguPei2GRbONkE8Zw+juAE6UYn0sTMY1l/ocG7uJ0V11kIVsYEx1Wl82U X+bnQ9t4uMkX0LvEwXYLagKN5r37LLb1ksmxcs8KQrIbTbdlp6DXjssVNq6V2qAOo0Wh EC0tnzk2pNeehboiH/7uUXWLb4/cWiJuoyeh/obxMgfdzg4L8doKZgpanzpyIZBmrMyz 6nEEK9kUxTAWQ/J8EFKpzEMAI3uyO80+/f+ZusEMRNRTrrxRVGdSgJbYd/Zw6+Eh2PBS xedw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bpBaXfVn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si4798783pgv.315.2019.05.06.07.38.40; Mon, 06 May 2019 07:38:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bpBaXfVn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727282AbfEFOg4 (ORCPT + 99 others); Mon, 6 May 2019 10:36:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:57412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbfEFOgy (ORCPT ); Mon, 6 May 2019 10:36:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6466C204EC; Mon, 6 May 2019 14:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153413; bh=u7p5P6Jm2JsxS41S7YKW9zJ8WvWyWSOAUkXtrXo7UA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bpBaXfVni/z/pkwjGwQ83jtSpdr00wXey3WAPjm63RBG6cd2rVrRpgeHkP0C89SR/ sRNL/MloKu3X0c43zqcGAGQKd+5N4g45Yc5mIymlZkDtf+9kzBkD1O/sHuxVIXU/2d sdc7AE8h1PDtAmet8da+OwsDzpW4ZpY/hptXyBUM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konstantin Khorenko , "David S. Miller" , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 049/122] bonding: show full hw address in sysfs for slave entries Date: Mon, 6 May 2019 16:31:47 +0200 Message-Id: <20190506143059.347507584@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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//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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin (Microsoft) --- 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.20.1