aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_api.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2025-05-21 20:46:10 +0000
committerPaolo Abeni <[email protected]>2025-05-27 06:25:42 +0000
commit161972650d6795ea00f8b72557cf3c3e593ed250 (patch)
treeae9e97e5674b98f5d107343c70786b43775e19e3 /net/core/dev_api.c
parentnet: core: Convert inet_addr_is_any() to sockaddr_storage (diff)
downloadkernel-161972650d6795ea00f8b72557cf3c3e593ed250.tar.gz
kernel-161972650d6795ea00f8b72557cf3c3e593ed250.zip
net: core: Switch netif_set_mac_address() to struct sockaddr_storage
In order to avoid passing around struct sockaddr that has a size the compiler cannot reason about (nor track at runtime), convert netif_set_mac_address() to take struct sockaddr_storage. This is just a cast conversion, so there is are no binary changes. Following patches will make actual allocation changes. Acked-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/core/dev_api.c')
-rw-r--r--net/core/dev_api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev_api.c b/net/core/dev_api.c
index f9a160ab596f..b5f293e637d9 100644
--- a/net/core/dev_api.c
+++ b/net/core/dev_api.c
@@ -91,7 +91,7 @@ int dev_set_mac_address_user(struct net_device *dev, struct sockaddr *sa,
down_write(&dev_addr_sem);
netdev_lock_ops(dev);
- ret = netif_set_mac_address(dev, sa, extack);
+ ret = netif_set_mac_address(dev, (struct sockaddr_storage *)sa, extack);
netdev_unlock_ops(dev);
up_write(&dev_addr_sem);
@@ -332,7 +332,7 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
int ret;
netdev_lock_ops(dev);
- ret = netif_set_mac_address(dev, sa, extack);
+ ret = netif_set_mac_address(dev, (struct sockaddr_storage *)sa, extack);
netdev_unlock_ops(dev);
return ret;