aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2025-05-27 08:25:45 +0200
committerPaolo Abeni <pabeni@redhat.com>2025-05-27 08:25:46 +0200
commit358bea91ce6b4f02e5df0143382c96d7083504bc (patch)
tree1b125a39db68d7241d227de66db8b3bef305fc35 /include/linux
parentreplace strncpy with strscpy_pad (diff)
parentnet: core: Convert dev_set_mac_address_user() to use struct sockaddr_storage (diff)
downloadwireguard-linux-358bea91ce6b4f02e5df0143382c96d7083504bc.tar.xz
wireguard-linux-358bea91ce6b4f02e5df0143382c96d7083504bc.zip
Merge branch 'net-convert-dev_set_mac_address-to-struct-sockaddr_storage'
Kees Cook says: ==================== net: Convert dev_set_mac_address() to struct sockaddr_storage As part of the effort to allow the compiler to reason about object sizes, we need to deal with the problematic variably sized struct sockaddr, which has no internal runtime size tracking. In much of the network stack the use of struct sockaddr_storage has been adopted. Continue the transition toward this for more of the internal APIs. Specifically: - inet_addr_is_any() - netif_set_mac_address() - dev_set_mac_address() - dev_set_mac_address_user() Only a few callers of dev_set_mac_address() needed adjustment; all others were already using struct sockaddr_storage internally. v1: https://lore.kernel.org/all/20250520222452.work.063-kees@kernel.org/ ==================== Link: https://patch.msgid.link/20250521204310.it.500-kees@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/inet.h2
-rw-r--r--include/linux/netdevice.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/inet.h b/include/linux/inet.h
index bd8276e96e60..9158772f3559 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -55,6 +55,6 @@ extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char
extern int inet_pton_with_scope(struct net *net, unsigned short af,
const char *src, const char *port, struct sockaddr_storage *addr);
-extern bool inet_addr_is_any(struct sockaddr *addr);
+bool inet_addr_is_any(struct sockaddr_storage *addr);
#endif /* _LINUX_INET_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ea9d335de130..adb14db25798 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4212,11 +4212,11 @@ int netif_set_mtu(struct net_device *dev, int new_mtu);
int dev_set_mtu(struct net_device *, int);
int dev_pre_changeaddr_notify(struct net_device *dev, const char *addr,
struct netlink_ext_ack *extack);
-int netif_set_mac_address(struct net_device *dev, struct sockaddr *sa,
+int netif_set_mac_address(struct net_device *dev, struct sockaddr_storage *ss,
struct netlink_ext_ack *extack);
-int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
+int dev_set_mac_address(struct net_device *dev, struct sockaddr_storage *ss,
struct netlink_ext_ack *extack);
-int dev_set_mac_address_user(struct net_device *dev, struct sockaddr *sa,
+int dev_set_mac_address_user(struct net_device *dev, struct sockaddr_storage *ss,
struct netlink_ext_ack *extack);
int dev_get_mac_address(struct sockaddr *sa, struct net *net, char *dev_name);
int dev_get_port_parent_id(struct net_device *dev,