dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Alexey Dobriyan 2008-10-15 22:04:23 -07:00 committed by Linus Torvalds
parent f40cbaa5b0
commit f221e726bf
16 changed files with 56 additions and 73 deletions

View File

@ -211,7 +211,7 @@ static int cmode_procctl(ctl_table *ctl, int write, struct file *filp,
return try_set_cmode(new_cmode)?:*lenp; return try_set_cmode(new_cmode)?:*lenp;
} }
static int cmode_sysctl(ctl_table *table, int __user *name, int nlen, static int cmode_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -314,7 +314,7 @@ static int p0_procctl(ctl_table *ctl, int write, struct file *filp,
return try_set_p0(new_p0)?:*lenp; return try_set_p0(new_p0)?:*lenp;
} }
static int p0_sysctl(ctl_table *table, int __user *name, int nlen, static int p0_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -358,7 +358,7 @@ static int cm_procctl(ctl_table *ctl, int write, struct file *filp,
return try_set_cm(new_cm)?:*lenp; return try_set_cm(new_cm)?:*lenp;
} }
static int cm_sysctl(ctl_table *table, int __user *name, int nlen, static int cm_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {

View File

@ -38,14 +38,13 @@
#endif #endif
/* Strategy function to write EEPROM after changing string entry */ /* Strategy function to write EEPROM after changing string entry */
int sysctl_lasatstring(ctl_table *table, int *name, int nlen, int sysctl_lasatstring(ctl_table *table,
void *oldval, size_t *oldlenp, void *oldval, size_t *oldlenp,
void *newval, size_t newlen) void *newval, size_t newlen)
{ {
int r; int r;
r = sysctl_string(table, name, r = sysctl_string(table, oldval, oldlenp, newval, newlen);
nlen, oldval, oldlenp, newval, newlen);
if (r < 0) if (r < 0)
return r; return r;
@ -113,13 +112,13 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
#endif #endif
/* Sysctl for setting the IP addresses */ /* Sysctl for setting the IP addresses */
int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen, int sysctl_lasat_intvec(ctl_table *table,
void *oldval, size_t *oldlenp, void *oldval, size_t *oldlenp,
void *newval, size_t newlen) void *newval, size_t newlen)
{ {
int r; int r;
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen); r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0) if (r < 0)
return r; return r;
@ -131,7 +130,7 @@ int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
#ifdef CONFIG_DS1603 #ifdef CONFIG_DS1603
/* Same for RTC */ /* Same for RTC */
int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen, int sysctl_lasat_rtc(ctl_table *table,
void *oldval, size_t *oldlenp, void *oldval, size_t *oldlenp,
void *newval, size_t newlen) void *newval, size_t newlen)
{ {
@ -140,7 +139,7 @@ int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen,
rtctmp = read_persistent_clock(); rtctmp = read_persistent_clock();
if (rtctmp < 0) if (rtctmp < 0)
rtctmp = 0; rtctmp = 0;
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen); r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0) if (r < 0)
return r; return r;
if (newval && newlen) if (newval && newlen)
@ -211,13 +210,13 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
} }
#endif #endif
static int sysctl_lasat_prid(ctl_table *table, int *name, int nlen, static int sysctl_lasat_prid(ctl_table *table,
void *oldval, size_t *oldlenp, void *oldval, size_t *oldlenp,
void *newval, size_t newlen) void *newval, size_t newlen)
{ {
int r; int r;
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen); r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0) if (r < 0)
return r; return r;
if (newval && newlen) { if (newval && newlen) {

View File

@ -1205,7 +1205,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos); return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos);
} }
static int uuid_strategy(ctl_table *table, int __user *name, int nlen, static int uuid_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {

View File

@ -972,7 +972,7 @@ extern int sysctl_perm(struct ctl_table_root *root,
typedef struct ctl_table ctl_table; typedef struct ctl_table ctl_table;
typedef int ctl_handler (struct ctl_table *table, int __user *name, int nlen, typedef int ctl_handler (struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen); void __user *newval, size_t newlen);

View File

@ -396,7 +396,7 @@ extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
int ipv4_doint_and_flush(ctl_table *ctl, int write, int ipv4_doint_and_flush(ctl_table *ctl, int write,
struct file* filp, void __user *buffer, struct file* filp, void __user *buffer,
size_t *lenp, loff_t *ppos); size_t *lenp, loff_t *ppos);
int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, int ipv4_doint_and_flush_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen); void __user *newval, size_t newlen);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS

View File

@ -129,9 +129,8 @@ extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
void __user *buffer, void __user *buffer,
size_t *lenp, size_t *lenp,
loff_t *ppos); loff_t *ppos);
int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl,
int nlen, void __user *oldval, void __user *oldval, size_t __user *oldlenp,
size_t __user *oldlenp,
void __user *newval, size_t newlen); void __user *newval, size_t newlen);
#endif #endif

View File

@ -131,7 +131,7 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
#ifdef CONFIG_SYSCTL_SYSCALL #ifdef CONFIG_SYSCTL_SYSCALL
/* The generic sysctl ipc data routine. */ /* The generic sysctl ipc data routine. */
static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen, static int sysctl_ipc_data(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -169,14 +169,13 @@ static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen,
return 1; return 1;
} }
static int sysctl_ipc_registered_data(ctl_table *table, int __user *name, static int sysctl_ipc_registered_data(ctl_table *table,
int nlen, void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
int rc; int rc;
rc = sysctl_ipc_data(table, name, nlen, oldval, oldlenp, newval, rc = sysctl_ipc_data(table, oldval, oldlenp, newval, newlen);
newlen);
if (newval && newlen && rc > 0) if (newval && newlen && rc > 0)
/* /*

View File

@ -1500,7 +1500,6 @@ void register_sysctl_root(struct ctl_table_root *root)
/* Perform the actual read/write of a sysctl table entry. */ /* Perform the actual read/write of a sysctl table entry. */
static int do_sysctl_strategy(struct ctl_table_root *root, static int do_sysctl_strategy(struct ctl_table_root *root,
struct ctl_table *table, struct ctl_table *table,
int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -1514,8 +1513,7 @@ static int do_sysctl_strategy(struct ctl_table_root *root,
return -EPERM; return -EPERM;
if (table->strategy) { if (table->strategy) {
rc = table->strategy(table, name, nlen, oldval, oldlenp, rc = table->strategy(table, oldval, oldlenp, newval, newlen);
newval, newlen);
if (rc < 0) if (rc < 0)
return rc; return rc;
if (rc > 0) if (rc > 0)
@ -1525,8 +1523,7 @@ static int do_sysctl_strategy(struct ctl_table_root *root,
/* If there is no strategy routine, or if the strategy returns /* If there is no strategy routine, or if the strategy returns
* zero, proceed with automatic r/w */ * zero, proceed with automatic r/w */
if (table->data && table->maxlen) { if (table->data && table->maxlen) {
rc = sysctl_data(table, name, nlen, oldval, oldlenp, rc = sysctl_data(table, oldval, oldlenp, newval, newlen);
newval, newlen);
if (rc < 0) if (rc < 0)
return rc; return rc;
} }
@ -1558,7 +1555,7 @@ repeat:
table = table->child; table = table->child;
goto repeat; goto repeat;
} }
error = do_sysctl_strategy(root, table, name, nlen, error = do_sysctl_strategy(root, table,
oldval, oldlenp, oldval, oldlenp,
newval, newlen); newval, newlen);
return error; return error;
@ -2707,7 +2704,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
*/ */
/* The generic sysctl data routine (used if no strategy routine supplied) */ /* The generic sysctl data routine (used if no strategy routine supplied) */
int sysctl_data(struct ctl_table *table, int __user *name, int nlen, int sysctl_data(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -2741,7 +2738,7 @@ int sysctl_data(struct ctl_table *table, int __user *name, int nlen,
} }
/* The generic string strategy routine: */ /* The generic string strategy routine: */
int sysctl_string(struct ctl_table *table, int __user *name, int nlen, int sysctl_string(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -2787,7 +2784,7 @@ int sysctl_string(struct ctl_table *table, int __user *name, int nlen,
* are between the minimum and maximum values given in the arrays * are between the minimum and maximum values given in the arrays
* table->extra1 and table->extra2, respectively. * table->extra1 and table->extra2, respectively.
*/ */
int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen, int sysctl_intvec(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -2823,7 +2820,7 @@ int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen,
} }
/* Strategy function to convert jiffies to seconds */ /* Strategy function to convert jiffies to seconds */
int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen, int sysctl_jiffies(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -2857,7 +2854,7 @@ int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen,
} }
/* Strategy function to convert jiffies to seconds */ /* Strategy function to convert jiffies to seconds */
int sysctl_ms_jiffies(struct ctl_table *table, int __user *name, int nlen, int sysctl_ms_jiffies(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -2912,35 +2909,35 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
return error; return error;
} }
int sysctl_data(struct ctl_table *table, int __user *name, int nlen, int sysctl_data(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
return -ENOSYS; return -ENOSYS;
} }
int sysctl_string(struct ctl_table *table, int __user *name, int nlen, int sysctl_string(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
return -ENOSYS; return -ENOSYS;
} }
int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen, int sysctl_intvec(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
return -ENOSYS; return -ENOSYS;
} }
int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen, int sysctl_jiffies(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
return -ENOSYS; return -ENOSYS;
} }
int sysctl_ms_jiffies(struct ctl_table *table, int __user *name, int nlen, int sysctl_ms_jiffies(struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {

View File

@ -60,7 +60,7 @@ static int proc_do_uts_string(ctl_table *table, int write, struct file *filp,
#ifdef CONFIG_SYSCTL_SYSCALL #ifdef CONFIG_SYSCTL_SYSCALL
/* The generic string strategy routine: */ /* The generic string strategy routine: */
static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen, static int sysctl_uts_string(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -69,8 +69,7 @@ static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen,
write = newval && newlen; write = newval && newlen;
memcpy(&uts_table, table, sizeof(uts_table)); memcpy(&uts_table, table, sizeof(uts_table));
uts_table.data = get_uts(table, write); uts_table.data = get_uts(table, write);
r = sysctl_string(&uts_table, name, nlen, r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen);
oldval, oldlenp, newval, newlen);
put_uts(table, write, uts_table.data); put_uts(table, write, uts_table.data);
return r; return r;
} }

View File

@ -166,7 +166,7 @@ static int max_priority[] = { 127 }; /* From DECnet spec */
static int dn_forwarding_proc(ctl_table *, int, struct file *, static int dn_forwarding_proc(ctl_table *, int, struct file *,
void __user *, size_t *, loff_t *); void __user *, size_t *, loff_t *);
static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen, static int dn_forwarding_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen); void __user *newval, size_t newlen);
@ -318,7 +318,7 @@ static int dn_forwarding_proc(ctl_table *table, int write,
#endif #endif
} }
static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen, static int dn_forwarding_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {

View File

@ -132,7 +132,7 @@ static int parse_addr(__le16 *addr, char *str)
} }
static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen, static int dn_node_address_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -217,7 +217,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
} }
static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen, static int dn_def_dev_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {

View File

@ -1283,7 +1283,7 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
return ret; return ret;
} }
static int devinet_conf_sysctl(ctl_table *table, int __user *name, int nlen, static int devinet_conf_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -1379,12 +1379,11 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
return ret; return ret;
} }
int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, int ipv4_doint_and_flush_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
int ret = devinet_conf_sysctl(table, name, nlen, oldval, oldlenp, int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen);
newval, newlen);
struct net *net = table->extra2; struct net *net = table->extra2;
if (ret == 1) if (ret == 1)

View File

@ -2908,8 +2908,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
} }
static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
int __user *name,
int nlen,
void __user *oldval, void __user *oldval,
size_t __user *oldlenp, size_t __user *oldlenp,
void __user *newval, void __user *newval,
@ -2972,16 +2970,13 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write,
} }
static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table, static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table,
int __user *name,
int nlen,
void __user *oldval, void __user *oldval,
size_t __user *oldlenp, size_t __user *oldlenp,
void __user *newval, void __user *newval,
size_t newlen) size_t newlen)
{ {
int old = ip_rt_secret_interval; int old = ip_rt_secret_interval;
int ret = sysctl_jiffies(table, name, nlen, oldval, oldlenp, newval, int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen);
newlen);
rt_secret_reschedule(old); rt_secret_reschedule(old);

View File

@ -64,8 +64,8 @@ static int ipv4_local_port_range(ctl_table *table, int write, struct file *filp,
} }
/* Validate changes from sysctl interface. */ /* Validate changes from sysctl interface. */
static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, static int ipv4_sysctl_local_port_range(ctl_table *table,
int nlen, void __user *oldval, void __user *oldval,
size_t __user *oldlenp, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -80,7 +80,7 @@ static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name,
}; };
inet_get_local_port_range(range, range + 1); inet_get_local_port_range(range, range + 1);
ret = sysctl_intvec(&tmp, name, nlen, oldval, oldlenp, newval, newlen); ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen);
if (ret == 0 && newval && newlen) { if (ret == 0 && newval && newlen) {
if (range[1] < range[0]) if (range[1] < range[0])
ret = -EINVAL; ret = -EINVAL;
@ -109,8 +109,8 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write, struct file *
return ret; return ret;
} }
static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, static int sysctl_tcp_congestion_control(ctl_table *table,
int nlen, void __user *oldval, void __user *oldval,
size_t __user *oldlenp, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
@ -122,7 +122,7 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name,
int ret; int ret;
tcp_get_default_congestion_control(val); tcp_get_default_congestion_control(val);
ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen);
if (ret == 1 && newval && newlen) if (ret == 1 && newval && newlen)
ret = tcp_set_default_congestion_control(val); ret = tcp_set_default_congestion_control(val);
return ret; return ret;
@ -165,8 +165,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl,
return ret; return ret;
} }
static int strategy_allowed_congestion_control(ctl_table *table, int __user *name, static int strategy_allowed_congestion_control(ctl_table *table,
int nlen, void __user *oldval, void __user *oldval,
size_t __user *oldlenp, size_t __user *oldlenp,
void __user *newval, void __user *newval,
size_t newlen) size_t newlen)
@ -179,7 +179,7 @@ static int strategy_allowed_congestion_control(ctl_table *table, int __user *nam
return -ENOMEM; return -ENOMEM;
tcp_get_available_congestion_control(tbl.data, tbl.maxlen); tcp_get_available_congestion_control(tbl.data, tbl.maxlen);
ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen);
if (ret == 1 && newval && newlen) if (ret == 1 && newval && newlen)
ret = tcp_set_allowed_congestion_control(tbl.data); ret = tcp_set_allowed_congestion_control(tbl.data);
kfree(tbl.data); kfree(tbl.data);

View File

@ -3982,7 +3982,6 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
} }
static int addrconf_sysctl_forward_strategy(ctl_table *table, static int addrconf_sysctl_forward_strategy(ctl_table *table,
int __user *name, int nlen,
void __user *oldval, void __user *oldval,
size_t __user *oldlenp, size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)

View File

@ -1730,9 +1730,8 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
return ret; return ret;
} }
int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl,
int nlen, void __user *oldval, void __user *oldval, size_t __user *oldlenp,
size_t __user *oldlenp,
void __user *newval, size_t newlen) void __user *newval, size_t newlen)
{ {
struct net_device *dev = ctl->extra1; struct net_device *dev = ctl->extra1;
@ -1745,13 +1744,11 @@ int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name,
switch (ctl->ctl_name) { switch (ctl->ctl_name) {
case NET_NEIGH_REACHABLE_TIME: case NET_NEIGH_REACHABLE_TIME:
ret = sysctl_jiffies(ctl, name, nlen, ret = sysctl_jiffies(ctl, oldval, oldlenp, newval, newlen);
oldval, oldlenp, newval, newlen);
break; break;
case NET_NEIGH_RETRANS_TIME_MS: case NET_NEIGH_RETRANS_TIME_MS:
case NET_NEIGH_REACHABLE_TIME_MS: case NET_NEIGH_REACHABLE_TIME_MS:
ret = sysctl_ms_jiffies(ctl, name, nlen, ret = sysctl_ms_jiffies(ctl, oldval, oldlenp, newval, newlen);
oldval, oldlenp, newval, newlen);
break; break;
default: default:
ret = 0; ret = 0;