netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 2/8] net: rtnetlink: use __dev_addr_set()
Date: Fri, 22 Oct 2021 16:20:57 -0700	[thread overview]
Message-ID: <20211022232103.2715312-3-kuba@kernel.org> (raw)
In-Reply-To: <20211022232103.2715312-1-kuba@kernel.org>

Get it ready for constant netdev->dev_addr.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 net/core/rtnetlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 79477dcae7c2..2af8aeeadadf 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3204,8 +3204,8 @@ struct net_device *rtnl_create_link(struct net *net, const char *ifname,
 		dev->mtu = mtu;
 	}
 	if (tb[IFLA_ADDRESS]) {
-		memcpy(dev->dev_addr, nla_data(tb[IFLA_ADDRESS]),
-				nla_len(tb[IFLA_ADDRESS]));
+		__dev_addr_set(dev, nla_data(tb[IFLA_ADDRESS]),
+			       nla_len(tb[IFLA_ADDRESS]));
 		dev->addr_assign_type = NET_ADDR_SET;
 	}
 	if (tb[IFLA_BROADCAST])
-- 
2.31.1


  parent reply	other threads:[~2021-10-22 23:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 23:20 [PATCH net-next v2 0/8] don't write directly to netdev->dev_addr Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 1/8] net: core: constify mac addrs in selftests Jakub Kicinski
2021-10-22 23:20 ` Jakub Kicinski [this message]
2021-10-22 23:20 ` [PATCH net-next v2 3/8] net: phy: constify netdev->dev_addr references Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 4/8] net: bonding: constify and use dev_addr_set() Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 5/8] net: hsr: get ready for const netdev->dev_addr Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 6/8] net: caif: " Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 7/8] net: drivers: " Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 8/8] net: atm: use address setting helpers Jakub Kicinski
2021-10-25 12:10 ` [PATCH net-next v2 0/8] don't write directly to netdev->dev_addr patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211022232103.2715312-3-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).