[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210325180817.840042-5-eric.dumazet@gmail.com>
Date: Thu, 25 Mar 2021 11:08:16 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: netdev <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: [PATCH net-next 4/5] inet: convert tcp_early_demux and udp_early_demux to u8
From: Eric Dumazet <edumazet@...gle.com>
For these sysctls, their dedicated helpers have
to use proc_dou8vec_minmax().
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
include/net/netns/ipv4.h | 4 ++--
net/ipv4/sysctl_net_ipv4.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index d2c0a6592ff6c0a3e954c157d109bf22d7bb701b..00f250ee441973586198014df8791c60ae298565 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -107,8 +107,8 @@ struct netns_ipv4 {
#ifdef CONFIG_NET_L3_MASTER_DEV
u8 sysctl_raw_l3mdev_accept;
#endif
- int sysctl_tcp_early_demux;
- int sysctl_udp_early_demux;
+ u8 sysctl_tcp_early_demux;
+ u8 sysctl_udp_early_demux;
u8 sysctl_nexthop_compat_mode;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 713e0c0c91e918274cb7cdf7212a6a3e5b8e140c..510a326356127c0a822f9a1215737a5c843fd58c 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -389,7 +389,7 @@ static int proc_tcp_early_demux(struct ctl_table *table, int write,
{
int ret = 0;
- ret = proc_dointvec(table, write, buffer, lenp, ppos);
+ ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos);
if (write && !ret) {
int enabled = init_net.ipv4.sysctl_tcp_early_demux;
@@ -405,7 +405,7 @@ static int proc_udp_early_demux(struct ctl_table *table, int write,
{
int ret = 0;
- ret = proc_dointvec(table, write, buffer, lenp, ppos);
+ ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos);
if (write && !ret) {
int enabled = init_net.ipv4.sysctl_udp_early_demux;
@@ -683,14 +683,14 @@ static struct ctl_table ipv4_net_table[] = {
{
.procname = "udp_early_demux",
.data = &init_net.ipv4.sysctl_udp_early_demux,
- .maxlen = sizeof(int),
+ .maxlen = sizeof(u8),
.mode = 0644,
.proc_handler = proc_udp_early_demux
},
{
.procname = "tcp_early_demux",
.data = &init_net.ipv4.sysctl_tcp_early_demux,
- .maxlen = sizeof(int),
+ .maxlen = sizeof(u8),
.mode = 0644,
.proc_handler = proc_tcp_early_demux
},
--
2.31.0.291.g576ba9dcdaf-goog
Powered by blists - more mailing lists