diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-16 01:04:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:47 -0400 |
commit | f221e726bf4e082a05dcd573379ac859bfba7126 (patch) | |
tree | a05f674caac693dc9aec7e46dd06115389f7ece3 /net/ipv4/sysctl_net_ipv4.c | |
parent | f40cbaa5b0a4719489e6e7947351c99a159aca30 (diff) |
sysctl: simplify ->strategy
name and nlen parameters passed to ->strategy hook are unused, remove
them. In general ->strategy hook should know what it's doing, and don't
do something tricky for which, say, pointer to original userspace array
may be needed (name).
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net> [ networking bits ]
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/ipv4/sysctl_net_ipv4.c')
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 276d047fb85a..1bb10df8ce7d 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -64,8 +64,8 @@ static int ipv4_local_port_range(ctl_table *table, int write, struct file *filp, | |||
64 | } | 64 | } |
65 | 65 | ||
66 | /* Validate changes from sysctl interface. */ | 66 | /* Validate changes from sysctl interface. */ |
67 | static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, | 67 | static int ipv4_sysctl_local_port_range(ctl_table *table, |
68 | int nlen, void __user *oldval, | 68 | void __user *oldval, |
69 | size_t __user *oldlenp, | 69 | size_t __user *oldlenp, |
70 | void __user *newval, size_t newlen) | 70 | void __user *newval, size_t newlen) |
71 | { | 71 | { |
@@ -80,7 +80,7 @@ static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | inet_get_local_port_range(range, range + 1); | 82 | inet_get_local_port_range(range, range + 1); |
83 | ret = sysctl_intvec(&tmp, name, nlen, oldval, oldlenp, newval, newlen); | 83 | ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen); |
84 | if (ret == 0 && newval && newlen) { | 84 | if (ret == 0 && newval && newlen) { |
85 | if (range[1] < range[0]) | 85 | if (range[1] < range[0]) |
86 | ret = -EINVAL; | 86 | ret = -EINVAL; |
@@ -109,8 +109,8 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write, struct file * | |||
109 | return ret; | 109 | return ret; |
110 | } | 110 | } |
111 | 111 | ||
112 | static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, | 112 | static int sysctl_tcp_congestion_control(ctl_table *table, |
113 | int nlen, void __user *oldval, | 113 | void __user *oldval, |
114 | size_t __user *oldlenp, | 114 | size_t __user *oldlenp, |
115 | void __user *newval, size_t newlen) | 115 | void __user *newval, size_t newlen) |
116 | { | 116 | { |
@@ -122,7 +122,7 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, | |||
122 | int ret; | 122 | int ret; |
123 | 123 | ||
124 | tcp_get_default_congestion_control(val); | 124 | tcp_get_default_congestion_control(val); |
125 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); | 125 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); |
126 | if (ret == 1 && newval && newlen) | 126 | if (ret == 1 && newval && newlen) |
127 | ret = tcp_set_default_congestion_control(val); | 127 | ret = tcp_set_default_congestion_control(val); |
128 | return ret; | 128 | return ret; |
@@ -165,8 +165,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl, | |||
165 | return ret; | 165 | return ret; |
166 | } | 166 | } |
167 | 167 | ||
168 | static int strategy_allowed_congestion_control(ctl_table *table, int __user *name, | 168 | static int strategy_allowed_congestion_control(ctl_table *table, |
169 | int nlen, void __user *oldval, | 169 | void __user *oldval, |
170 | size_t __user *oldlenp, | 170 | size_t __user *oldlenp, |
171 | void __user *newval, | 171 | void __user *newval, |
172 | size_t newlen) | 172 | size_t newlen) |
@@ -179,7 +179,7 @@ static int strategy_allowed_congestion_control(ctl_table *table, int __user *nam | |||
179 | return -ENOMEM; | 179 | return -ENOMEM; |
180 | 180 | ||
181 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); | 181 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); |
182 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); | 182 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); |
183 | if (ret == 1 && newval && newlen) | 183 | if (ret == 1 && newval && newlen) |
184 | ret = tcp_set_allowed_congestion_control(tbl.data); | 184 | ret = tcp_set_allowed_congestion_control(tbl.data); |
185 | kfree(tbl.data); | 185 | kfree(tbl.data); |