diff options
author | Joel Granados <joel.granados@gmail.com> | 2023-08-09 13:50:03 +0300 |
---|---|---|
committer | Luis Chamberlain <mcgrof@kernel.org> | 2023-08-16 01:26:18 +0300 |
commit | c899710fe7f9f24dd77135875f199359f7b8b774 (patch) | |
tree | 096559bda97f2123d3a74b4557b6de3491a578cd /net/mptcp | |
parent | 385a5dc9e578bdc43bf5196258f699f08612379b (diff) | |
download | linux-c899710fe7f9f24dd77135875f199359f7b8b774.tar.xz |
networking: Update to register_net_sysctl_sz
Move from register_net_sysctl to register_net_sysctl_sz for all the
networking related files. Do this while making sure to mirror the NULL
assignments with a table_size of zero for the unprivileged users.
We need to move to the new function in preparation for when we change
SIZE_MAX to ARRAY_SIZE() in the register_net_sysctl macro. Failing to do
so would erroneously allow ARRAY_SIZE() to be called on a pointer. We
hold off the SIZE_MAX to ARRAY_SIZE change until we have migrated all
the relevant net sysctl registering functions to register_net_sysctl_sz
in subsequent commits.
An additional size function was added to the following files in order to
calculate the size of an array that is defined in another file:
include/net/ipv6.h
net/ipv6/icmp.c
net/ipv6/route.c
net/ipv6/sysctl_net_ipv6.c
Signed-off-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'net/mptcp')
-rw-r--r-- | net/mptcp/ctrl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c index ae20b7d92e28..43e540328a52 100644 --- a/net/mptcp/ctrl.c +++ b/net/mptcp/ctrl.c @@ -150,7 +150,8 @@ static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet) table[4].data = &pernet->stale_loss_cnt; table[5].data = &pernet->pm_type; - hdr = register_net_sysctl(net, MPTCP_SYSCTL_PATH, table); + hdr = register_net_sysctl_sz(net, MPTCP_SYSCTL_PATH, table, + ARRAY_SIZE(mptcp_sysctl_table)); if (!hdr) goto err_reg; |