summaryrefslogtreecommitdiff
path: root/net/core/dev_addr_lists.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-11-19 06:21:51 -0800
committerDavid S. Miller <davem@davemloft.net>2021-11-20 12:25:57 +0000
commitadeef3e32146a8d2a73c399dc6f5d76a449131b1 (patch)
tree09f686c5e7c77b11de2d99d70b5e3e4f904969a5 /net/core/dev_addr_lists.c
parentc9646a18033ea2c3a6d27c951dedf4f60a290bf9 (diff)
net: constify netdev->dev_addr
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. We converted all users to make modifications via appropriate helpers, make netdev->dev_addr const. The update helpers need to upcast from the buffer to struct netdev_hw_addr. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev_addr_lists.c')
-rw-r--r--net/core/dev_addr_lists.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index f0cb38344126..ae8b1ef00fec 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -549,6 +549,16 @@ int dev_addr_init(struct net_device *dev)
}
EXPORT_SYMBOL(dev_addr_init);
+void dev_addr_mod(struct net_device *dev, unsigned int offset,
+ const void *addr, size_t len)
+{
+ struct netdev_hw_addr *ha;
+
+ ha = container_of(dev->dev_addr, struct netdev_hw_addr, addr[0]);
+ memcpy(&ha->addr[offset], addr, len);
+}
+EXPORT_SYMBOL(dev_addr_mod);
+
/**
* dev_addr_add - Add a device address
* @dev: device