Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6: (43 commits)
  security/tomoyo: Remove now unnecessary handling of security_sysctl.
  security/tomoyo: Add a special case to handle accesses through the internal proc mount.
  sysctl: Drop & in front of every proc_handler.
  sysctl: Remove CTL_NONE and CTL_UNNUMBERED
  sysctl: kill dead ctl_handler definitions.
  sysctl: Remove the last of the generic binary sysctl support
  sysctl net: Remove unused binary sysctl code
  sysctl security/tomoyo: Don't look at ctl_name
  sysctl arm: Remove binary sysctl support
  sysctl x86: Remove dead binary sysctl support
  sysctl sh: Remove dead binary sysctl support
  sysctl powerpc: Remove dead binary sysctl support
  sysctl ia64: Remove dead binary sysctl support
  sysctl s390: Remove dead sysctl binary support
  sysctl frv: Remove dead binary sysctl support
  sysctl mips/lasat: Remove dead binary sysctl support
  sysctl drivers: Remove dead binary sysctl support
  sysctl crypto: Remove dead binary sysctl support
  sysctl security/keys: Remove dead binary sysctl support
  sysctl kernel: Remove binary sysctl logic
  ...
This commit is contained in:
Linus Torvalds 2009-12-08 07:38:50 -08:00
commit 1557d33007
135 changed files with 2183 additions and 4748 deletions

View File

@ -1,22 +0,0 @@
Except for a few extremely rare exceptions user space applications do not use
the binary sysctl interface. Instead everyone uses /proc/sys/... with
readable ascii names.
Recently the kernel has started supporting setting the binary sysctl value to
CTL_UNNUMBERED so we no longer need to assign a binary sysctl path to allow
sysctls to show up in /proc/sys.
Assigning binary sysctl numbers is an endless source of conflicts in sysctl.h,
breaking of the user space ABI (because of those conflicts), and maintenance
problems. A complete pass through all of the sysctl users revealed multiple
instances where the sysctl binary interface was broken and had gone undetected
for years.
So please do not add new binary sysctl numbers. They are unneeded and
problematic.
If you really need a new binary sysctl number please first merge your sysctl
into the kernel and then as a separate patch allocate a binary sysctl number.
(ebiederm@xmission.com, June 2007)

View File

@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;
static ctl_table ctl_isa_vars[4] = {
{
.ctl_name = BUS_ISA_MEM_BASE,
.procname = "membase",
.data = &isa_membase,
.maxlen = sizeof(isa_membase),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
}, {
.ctl_name = BUS_ISA_PORT_BASE,
.procname = "portbase",
.data = &isa_portbase,
.maxlen = sizeof(isa_portbase),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
}, {
.ctl_name = BUS_ISA_PORT_SHIFT,
.procname = "portshift",
.data = &isa_portshift,
.maxlen = sizeof(isa_portshift),
.mode = 0444,
.proc_handler = &proc_dointvec,
}, {0}
.proc_handler = proc_dointvec,
}, {}
};
static struct ctl_table_header *isa_sysctl_header;
static ctl_table ctl_isa[2] = {
{
.ctl_name = CTL_BUS_ISA,
.procname = "isa",
.mode = 0555,
.child = ctl_isa_vars,
}, {0}
}, {}
};
static ctl_table ctl_bus[2] = {
{
.ctl_name = CTL_BUS,
.procname = "bus",
.mode = 0555,
.child = ctl_isa,
}, {0}
}, {}
};
void __init

View File

@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio)
EXPORT_SYMBOL(bcmring_gpio_reg_lock);
#endif
/* FIXME: temporary solution */
#define BCM_SYSCTL_REBOOT_WARM 1
#define CTL_BCM_REBOOT 112
/* sysctl */
int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */
@ -58,18 +54,16 @@ static struct ctl_table_header *bcmring_sysctl_header;
static struct ctl_table bcmring_sysctl_warm_reboot[] = {
{
.ctl_name = BCM_SYSCTL_REBOOT_WARM,
.procname = "warm",
.data = &bcmring_arch_warm_reboot,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec},
.proc_handler = proc_dointvec},
{}
};
static struct ctl_table bcmring_sysctl_reboot[] = {
{
.ctl_name = CTL_BCM_REBOOT,
.procname = "reboot",
.mode = 0555,
.child = bcmring_sysctl_warm_reboot},

View File

@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
return try_set_cmode(new_cmode)?:*lenp;
}
static int cmode_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
if (get_user(oldlen, oldlenp))
return -EFAULT;
if (oldlen != sizeof(int))
return -EINVAL;
if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_cmode;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new_cmode, (int __user *)newval))
return -EFAULT;
return try_set_cmode(new_cmode)?:1;
}
return 1;
}
static int try_set_p0(int new_p0)
{
unsigned long flags, clkc;
@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
return try_set_p0(new_p0)?:*lenp;
}
static int p0_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
if (get_user(oldlen, oldlenp))
return -EFAULT;
if (oldlen != sizeof(int))
return -EINVAL;
if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_p0;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new_p0, (int __user *)newval))
return -EFAULT;
return try_set_p0(new_p0)?:1;
}
return 1;
}
static int cm_procctl(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos)
{
@ -358,87 +296,47 @@ static int cm_procctl(ctl_table *ctl, int write,
return try_set_cm(new_cm)?:*lenp;
}
static int cm_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
if (get_user(oldlen, oldlenp))
return -EFAULT;
if (oldlen != sizeof(int))
return -EINVAL;
if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_cm;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new_cm, (int __user *)newval))
return -EFAULT;
return try_set_cm(new_cm)?:1;
}
return 1;
}
static struct ctl_table pm_table[] =
{
{
.ctl_name = CTL_PM_SUSPEND,
.procname = "suspend",
.data = NULL,
.maxlen = 0,
.mode = 0200,
.proc_handler = &sysctl_pm_do_suspend,
.proc_handler = sysctl_pm_do_suspend,
},
{
.ctl_name = CTL_PM_CMODE,
.procname = "cmode",
.data = &clock_cmode_current,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cmode_procctl,
.strategy = &cmode_sysctl,
.proc_handler = cmode_procctl,
},
{
.ctl_name = CTL_PM_P0,
.procname = "p0",
.data = &clock_p0_current,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &p0_procctl,
.strategy = &p0_sysctl,
.proc_handler = p0_procctl,
},
{
.ctl_name = CTL_PM_CM,
.procname = "cm",
.data = &clock_cm_current,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cm_procctl,
.strategy = &cm_sysctl,
.proc_handler = cm_procctl,
},
{ .ctl_name = 0}
{ }
};
static struct ctl_table pm_dir_table[] =
{
{
.ctl_name = CTL_PM,
.procname = "pm",
.mode = 0555,
.child = pm_table,
},
{ .ctl_name = 0}
{ }
};
/*

View File

@ -176,21 +176,19 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
static struct ctl_table frv_table[] =
{
{
.ctl_name = 1,
.procname = "cache-mode",
.data = NULL,
.maxlen = 0,
.mode = 0644,
.proc_handler = &procctl_frv_cachemode,
.proc_handler = procctl_frv_cachemode,
},
#ifdef CONFIG_MMU
{
.ctl_name = 2,
.procname = "pin-cxnr",
.data = NULL,
.maxlen = 0,
.mode = 0644,
.proc_handler = &procctl_frv_pin_cxnr
.proc_handler = procctl_frv_pin_cxnr
},
#endif
{}
@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
static struct ctl_table frv_dir_table[] =
{
{
.ctl_name = CTL_FRV,
.procname = "frv",
.mode = 0555,
.child = frv_table

View File

@ -327,7 +327,7 @@ ia32_syscall_table:
data8 compat_sys_writev
data8 sys_getsid
data8 sys_fdatasync
data8 sys32_sysctl
data8 compat_sys_sysctl
data8 sys_mlock /* 150 */
data8 sys_munlock
data8 sys_mlockall

View File

@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags)
return sys_msync(addr, len + (start - addr), flags);
}
struct sysctl32 {
unsigned int name;
int nlen;
unsigned int oldval;
unsigned int oldlenp;
unsigned int newval;
unsigned int newlen;
unsigned int __unused[4];
};
#ifdef CONFIG_SYSCTL_SYSCALL
asmlinkage long
sys32_sysctl (struct sysctl32 __user *args)
{
struct sysctl32 a32;
mm_segment_t old_fs = get_fs ();
void __user *oldvalp, *newvalp;
size_t oldlen;
int __user *namep;
long ret;
if (copy_from_user(&a32, args, sizeof(a32)))
return -EFAULT;
/*
* We need to pre-validate these because we have to disable address checking
* before calling do_sysctl() because of OLDLEN but we can't run the risk of the
* user specifying bad addresses here. Well, since we're dealing with 32 bit
* addresses, we KNOW that access_ok() will always succeed, so this is an
* expensive NOP, but so what...
*/
namep = (int __user *) compat_ptr(a32.name);
oldvalp = compat_ptr(a32.oldval);
newvalp = compat_ptr(a32.newval);
if ((oldvalp && get_user(oldlen, (int __user *) compat_ptr(a32.oldlenp)))
|| !access_ok(VERIFY_WRITE, namep, 0)
|| !access_ok(VERIFY_WRITE, oldvalp, 0)
|| !access_ok(VERIFY_WRITE, newvalp, 0))
return -EFAULT;
set_fs(KERNEL_DS);
lock_kernel();
ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen,
newvalp, (size_t) a32.newlen);
unlock_kernel();
set_fs(old_fs);
if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp)))
return -EFAULT;
return ret;
}
#endif
asmlinkage long
sys32_newuname (struct new_utsname __user *name)
{

View File

@ -239,32 +239,29 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
#ifdef CONFIG_SYSCTL
static ctl_table kdump_ctl_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "kdump_on_init",
.data = &kdump_on_init,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "kdump_on_fatal_mca",
.data = &kdump_on_fatal_mca,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table sys_table[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = kdump_ctl_table,
},
{ .ctl_name = 0 }
{ }
};
#endif

View File

@ -522,42 +522,37 @@ EXPORT_SYMBOL(pfm_sysctl);
static ctl_table pfm_ctl_table[]={
{
.ctl_name = CTL_UNNUMBERED,
.procname = "debug",
.data = &pfm_sysctl.debug,
.maxlen = sizeof(int),
.mode = 0666,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "debug_ovfl",
.data = &pfm_sysctl.debug_ovfl,
.maxlen = sizeof(int),
.mode = 0666,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "fastctxsw",
.data = &pfm_sysctl.fastctxsw,
.maxlen = sizeof(int),
.mode = 0600,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "expert_mode",
.data = &pfm_sysctl.expert_mode,
.maxlen = sizeof(int),
.mode = 0600,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{}
};
static ctl_table pfm_sysctl_dir[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "perfmon",
.mode = 0555,
.child = pfm_ctl_table,
@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = {
};
static ctl_table pfm_sysctl_root[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = pfm_sysctl_dir,

View File

@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
}
#endif
struct sysctl_args32
{
compat_caddr_t name;
int nlen;
compat_caddr_t oldval;
compat_caddr_t oldlenp;
compat_caddr_t newval;
compat_size_t newlen;
unsigned int __unused[4];
};
#ifdef CONFIG_SYSCTL_SYSCALL
SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
{
struct sysctl_args32 tmp;
int error;
size_t oldlen;
size_t __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
put_user(oldlen, (size_t __user *)addr))
return -EFAULT;
oldlenp = (size_t __user *)addr;
}
lock_kernel();
error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t __user *)addr) ||
put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
error = -EFAULT;
}
copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
}
return error;
}
#else
SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
{
return -ENOSYS;
}
#endif /* CONFIG_SYSCTL_SYSCALL */
SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
{
int ret = 0;

View File

@ -272,7 +272,7 @@ EXPORT(sysn32_call_table)
PTR sys_munlockall
PTR sys_vhangup /* 6150 */
PTR sys_pivot_root
PTR sys_32_sysctl
PTR compat_sys_sysctl
PTR sys_prctl
PTR compat_sys_adjtimex
PTR compat_sys_setrlimit /* 6155 */

View File

@ -356,7 +356,7 @@ sys_call_table:
PTR sys_ni_syscall /* 4150 */
PTR sys_getsid
PTR sys_fdatasync
PTR sys_32_sysctl
PTR compat_sys_sysctl
PTR sys_mlock
PTR sys_munlock /* 4155 */
PTR sys_mlockall

View File

@ -37,23 +37,6 @@
#include "ds1603.h"
#endif
/* Strategy function to write EEPROM after changing string entry */
int sysctl_lasatstring(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_string(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
lasat_write_eeprom_info();
return 0;
}
/* And the same for proc */
int proc_dolasatstring(ctl_table *table, int write,
@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
}
#endif
/* Sysctl for setting the IP addresses */
int sysctl_lasat_intvec(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
lasat_write_eeprom_info();
return 0;
}
#ifdef CONFIG_DS1603
/* Same for RTC */
int sysctl_lasat_rtc(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
struct timespec ts;
int r;
read_persistent_clock(&ts);
rtctmp = ts.tv_sec;
if (rtctmp < 0)
rtctmp = 0;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
rtc_mips_set_mmss(rtctmp);
return r;
}
#endif
#ifdef CONFIG_INET
int proc_lasat_ip(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
}
#endif
static int sysctl_lasat_prid(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen) {
lasat_board_info.li_eeprom_info.prid = *(int *)newval;
lasat_write_eeprom_info();
lasat_init_board_info();
}
return 0;
}
int proc_lasat_prid(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
@ -252,115 +178,92 @@ extern int lasat_boot_to_service;
static ctl_table lasat_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "cpu-hz",
.data = &lasat_board_info.li_cpu_hz,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "bus-hz",
.data = &lasat_board_info.li_bus_hz,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "bmid",
.data = &lasat_board_info.li_bmid,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "prid",
.data = &lasat_board_info.li_prid,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_lasat_prid,
.strategy = &sysctl_lasat_prid
},
.proc_handler = proc_lasat_prid,
. },
#ifdef CONFIG_INET
{
.ctl_name = CTL_UNNUMBERED,
.procname = "ipaddr",
.data = &lasat_board_info.li_eeprom_info.ipaddr,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
.proc_handler = proc_lasat_ip,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "netmask",
.data = &lasat_board_info.li_eeprom_info.netmask,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
.proc_handler = proc_lasat_ip,
},
#endif
{
.ctl_name = CTL_UNNUMBERED,
.procname = "passwd_hash",
.data = &lasat_board_info.li_eeprom_info.passwd_hash,
.maxlen =
sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
.mode = 0600,
.proc_handler = &proc_dolasatstring,
.strategy = &sysctl_lasatstring
.proc_handler = proc_dolasatstring,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "boot-service",
.data = &lasat_boot_to_service,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec
.proc_handler = proc_dointvec,
},
#ifdef CONFIG_DS1603
{
.ctl_name = CTL_UNNUMBERED,
.procname = "rtc",
.data = &rtctmp,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dolasatrtc,
.strategy = &sysctl_lasat_rtc
.proc_handler = proc_dolasatrtc,
},
#endif
{
.ctl_name = CTL_UNNUMBERED,
.procname = "namestr",
.data = &lasat_board_info.li_namestr,
.maxlen = sizeof(lasat_board_info.li_namestr),
.mode = 0444,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string
.proc_handler = proc_dostring,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "typestr",
.data = &lasat_board_info.li_typestr,
.maxlen = sizeof(lasat_board_info.li_typestr),
.mode = 0444,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string
.proc_handler = proc_dostring,
},
{}
};
static ctl_table lasat_root_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "lasat",
.mode = 0555,
.child = lasat_table

View File

@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
return -ENOSYS;
}
#ifdef CONFIG_SYSCTL
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
#ifndef CONFIG_SYSCTL_SYSCALL
return -ENOSYS;
#else
struct __sysctl_args32 tmp;
int error;
unsigned int oldlen32;
size_t oldlen, __user *oldlenp = NULL;
unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;
DBG(("sysctl32(%p)\n", args));
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
/* a possibly better hack than this, which will avoid the
* problem if the struct is read only, is to push the
* 'oldlen' value out to the user's stack instead. -PB
*/
if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
return -EFAULT;
oldlen = oldlen32;
if (put_user(oldlen, (size_t *)addr))
return -EFAULT;
oldlenp = (size_t *)addr;
}
lock_kernel();
error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
(void __user *)(u64)tmp.oldval, oldlenp,
(void __user *)(u64)tmp.newval, tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t *)addr)) {
error = -EFAULT;
} else {
oldlen32 = oldlen;
if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
error = -EFAULT;
}
}
if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
#endif
}
#endif /* CONFIG_SYSCTL */
asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
struct compat_timespec __user *interval)
{

View File

@ -234,7 +234,7 @@
ENTRY_SAME(getsid)
ENTRY_SAME(fdatasync)
/* struct __sysctl_args is a mess */
ENTRY_DIFF(sysctl)
ENTRY_COMP(sysctl)
ENTRY_SAME(mlock) /* 150 */
ENTRY_SAME(munlock)
ENTRY_SAME(mlockall)

View File

@ -110,18 +110,16 @@ int powersave_nap;
*/
static ctl_table powersave_nap_ctl_table[]={
{
.ctl_name = KERN_PPC_POWERSAVE_NAP,
.procname = "powersave-nap",
.data = &powersave_nap,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{}
};
static ctl_table powersave_nap_sysctl_root[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = powersave_nap_ctl_table,

View File

@ -520,58 +520,6 @@ asmlinkage long compat_sys_umask(u32 mask)
return sys_umask((int)mask);
}
#ifdef CONFIG_SYSCTL_SYSCALL
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long compat_sys_sysctl(struct __sysctl_args32 __user *args)
{
struct __sysctl_args32 tmp;
int error;
size_t oldlen;
size_t __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
oldlenp = (size_t __user *)addr;
if (get_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)) ||
put_user(oldlen, oldlenp))
return -EFAULT;
}
lock_kernel();
error = do_sysctl(compat_ptr(tmp.name), tmp.nlen,
compat_ptr(tmp.oldval), oldlenp,
compat_ptr(tmp.newval), tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, oldlenp) ||
put_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)))
error = -EFAULT;
}
copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
}
return error;
}
#endif
unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)

View File

@ -61,12 +61,12 @@ static struct ctl_table appldata_table[] = {
{
.procname = "timer",
.mode = S_IRUGO | S_IWUSR,
.proc_handler = &appldata_timer_handler,
.proc_handler = appldata_timer_handler,
},
{
.procname = "interval",
.mode = S_IRUGO | S_IWUSR,
.proc_handler = &appldata_interval_handler,
.proc_handler = appldata_interval_handler,
},
{ },
};

View File

@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
return ret;
}
#ifdef CONFIG_SYSCTL_SYSCALL
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
struct __sysctl_args32 tmp;
int error;
size_t oldlen;
size_t __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) ||
put_user(oldlen, (size_t __user *)addr))
return -EFAULT;
oldlenp = (size_t __user *)addr;
}
lock_kernel();
error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval),
oldlenp, compat_ptr(tmp.newval), tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t __user *)addr) ||
put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
error = -EFAULT;
}
if (copy_to_user(args->__unused, tmp.__unused,
sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
}
#endif
struct stat64_emu31 {
unsigned long long st_dev;
unsigned int __pad1;

View File

@ -162,7 +162,6 @@ struct ucontext32 {
compat_sigset_t uc_sigmask; /* mask last for extensibility */
};
struct __sysctl_args32;
struct stat64_emu31;
struct mmap_arg_struct_emu31;
struct fadvise64_64_args;
@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
size_t count);
long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
s32 count);
long sys32_sysctl(struct __sysctl_args32 __user *args);
long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf);
long sys32_lstat64(char __user * filename,
struct stat64_emu31 __user * statbuf);

View File

@ -689,8 +689,6 @@ sys32_fdatasync_wrapper:
llgfr %r2,%r2 # unsigned int
jg sys_fdatasync # branch to system call
#sys32_sysctl_wrapper # tbd
.globl sys32_mlock_wrapper
sys32_mlock_wrapper:
llgfr %r2,%r2 # unsigned long
@ -1087,8 +1085,8 @@ sys32_stime_wrapper:
.globl sys32_sysctl_wrapper
sys32_sysctl_wrapper:
llgtr %r2,%r2 # struct __sysctl_args32 *
jg sys32_sysctl
llgtr %r2,%r2 # struct compat_sysctl_args *
jg compat_sys_sysctl
.globl sys32_fstat64_wrapper
sys32_fstat64_wrapper:

View File

@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write,
static struct ctl_table s390dbf_table[] = {
{
.ctl_name = CTL_S390DBF_STOPPABLE,
.procname = "debug_stoppable",
.data = &debug_stoppable,
.maxlen = sizeof(int),
.mode = S_IRUGO | S_IWUSR,
.proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_S390DBF_ACTIVE,
.procname = "debug_active",
.data = &debug_active,
.maxlen = sizeof(int),
.mode = S_IRUGO | S_IWUSR,
.proc_handler = &s390dbf_procactive,
.strategy = &sysctl_intvec,
.proc_handler = s390dbf_procactive,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table s390dbf_dir_table[] = {
{
.ctl_name = CTL_S390DBF,
.procname = "s390dbf",
.maxlen = 0,
.mode = S_IRUGO | S_IXUGO,
.child = s390dbf_table,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table_header *s390dbf_sysctl_header;

View File

@ -343,30 +343,29 @@ static struct ctl_table cmm_table[] = {
{
.procname = "cmm_pages",
.mode = 0644,
.proc_handler = &cmm_pages_handler,
.proc_handler = cmm_pages_handler,
},
{
.procname = "cmm_timed_pages",
.mode = 0644,
.proc_handler = &cmm_pages_handler,
.proc_handler = cmm_pages_handler,
},
{
.procname = "cmm_timeout",
.mode = 0644,
.proc_handler = &cmm_timeout_handler,
.proc_handler = cmm_timeout_handler,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table cmm_dir_table[] = {
{
.ctl_name = CTL_VM,
.procname = "vm",
.maxlen = 0,
.mode = 0555,
.child = cmm_table,
},
{ .ctl_name = 0 }
{ }
};
#endif

View File

@ -877,44 +877,39 @@ static int misaligned_fixup(struct pt_regs *regs)
static ctl_table unaligned_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "kernel_reports",
.data = &kernel_mode_unaligned_fixup_count,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
.proc_handler = proc_dointvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "user_reports",
.data = &user_mode_unaligned_fixup_count,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
.proc_handler = proc_dointvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "user_enable",
.data = &user_mode_unaligned_fixup_enable,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec},
.proc_handler = proc_dointvec},
{}
};
static ctl_table unaligned_root[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "unaligned_fixup",
.mode = 0555,
unaligned_table
.child = unaligned_table
},
{}
};
static ctl_table sh64_root[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "sh64",
.mode = 0555,
.child = unaligned_root

View File

@ -591,63 +591,6 @@ out:
return ret;
}
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
#ifndef CONFIG_SYSCTL_SYSCALL
return -ENOSYS;
#else
struct __sysctl_args32 tmp;
int error;
size_t oldlen, __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) ||
put_user(oldlen, (size_t __user *)addr))
return -EFAULT;
oldlenp = (size_t __user *)addr;
}
lock_kernel();
error = do_sysctl((int __user *)(unsigned long) tmp.name,
tmp.nlen,
(void __user *)(unsigned long) tmp.oldval,
oldlenp,
(void __user *)(unsigned long) tmp.newval,
tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t __user *)addr) ||
put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
error = -EFAULT;
}
if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
#endif
}
long sys32_lookup_dcookie(unsigned long cookie_high,
unsigned long cookie_low,
char __user *buf, size_t len)

View File

@ -68,7 +68,7 @@ sys_call_table32:
.word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall
/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
.word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
/*250*/ .word sys32_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
.word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
.word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy

View File

@ -653,7 +653,7 @@ ia32_sys_call_table:
.quad compat_sys_writev
.quad sys_getsid
.quad sys_fdatasync
.quad sys32_sysctl /* sysctl */
.quad compat_sys_sysctl /* sysctl */
.quad sys_mlock /* 150 */
.quad sys_munlock
.quad sys_mlockall

View File

@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
return ret;
}
#ifdef CONFIG_SYSCTL_SYSCALL
struct sysctl_ia32 {
unsigned int name;
int nlen;
unsigned int oldval;
unsigned int oldlenp;
unsigned int newval;
unsigned int newlen;
unsigned int __unused[4];
};
asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32)
{
struct sysctl_ia32 a32;
mm_segment_t old_fs = get_fs();
void __user *oldvalp, *newvalp;
size_t oldlen;
int __user *namep;
long ret;
if (copy_from_user(&a32, args32, sizeof(a32)))
return -EFAULT;
/*
* We need to pre-validate these because we have to disable
* address checking before calling do_sysctl() because of
* OLDLEN but we can't run the risk of the user specifying bad
* addresses here. Well, since we're dealing with 32 bit
* addresses, we KNOW that access_ok() will always succeed, so
* this is an expensive NOP, but so what...
*/
namep = compat_ptr(a32.name);
oldvalp = compat_ptr(a32.oldval);
newvalp = compat_ptr(a32.newval);
if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
|| !access_ok(VERIFY_WRITE, namep, 0)
|| !access_ok(VERIFY_WRITE, oldvalp, 0)
|| !access_ok(VERIFY_WRITE, newvalp, 0))
return -EFAULT;
set_fs(KERNEL_DS);
lock_kernel();
ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen,
newvalp, (size_t) a32.newlen);
unlock_kernel();
set_fs(old_fs);
if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
return -EFAULT;
return ret;
}
#endif
/* warning: next two assume little endian */
asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
u32 poslo, u32 poshi)

View File

@ -51,11 +51,6 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
#ifdef CONFIG_SYSCTL_SYSCALL
struct sysctl_ia32;
asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *);
#endif
asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);

View File

@ -237,7 +237,7 @@ static ctl_table kernel_table2[] = {
};
static ctl_table kernel_root_table2[] = {
{ .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555,
{ .procname = "kernel", .mode = 0555,
.child = kernel_table2 },
{}
};

View File

@ -393,7 +393,6 @@ static ctl_table abi_table2[] = {
static ctl_table abi_root_table2[] = {
{
.ctl_name = CTL_ABI,
.procname = "abi",
.mode = 0555,
.child = abi_table2

View File

@ -25,28 +25,22 @@
#ifdef CONFIG_CRYPTO_FIPS
static struct ctl_table crypto_sysctl_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "fips_enabled",
.data = &fips_enabled,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec
},
{
.ctl_name = 0,
.proc_handler = proc_dointvec
},
{}
};
static struct ctl_table crypto_dir_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "crypto",
.mode = 0555,
.child = crypto_sysctl_table
},
{
.ctl_name = 0,
},
{}
};
static struct ctl_table_header *crypto_sysctls;

View File

@ -3557,67 +3557,65 @@ static ctl_table cdrom_table[] = {
.data = &cdrom_sysctl_settings.info,
.maxlen = CDROM_STR_SIZE,
.mode = 0444,
.proc_handler = &cdrom_sysctl_info,
.proc_handler = cdrom_sysctl_info,
},
{
.procname = "autoclose",
.data = &cdrom_sysctl_settings.autoclose,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cdrom_sysctl_handler,
.proc_handler = cdrom_sysctl_handler,
},
{
.procname = "autoeject",
.data = &cdrom_sysctl_settings.autoeject,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cdrom_sysctl_handler,
.proc_handler = cdrom_sysctl_handler,
},
{
.procname = "debug",
.data = &cdrom_sysctl_settings.debug,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cdrom_sysctl_handler,
.proc_handler = cdrom_sysctl_handler,
},
{
.procname = "lock",
.data = &cdrom_sysctl_settings.lock,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cdrom_sysctl_handler,
.proc_handler = cdrom_sysctl_handler,
},
{
.procname = "check_media",
.data = &cdrom_sysctl_settings.check,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cdrom_sysctl_handler
.proc_handler = cdrom_sysctl_handler
},
{ .ctl_name = 0 }
{ }
};
static ctl_table cdrom_cdrom_table[] = {
{
.ctl_name = DEV_CDROM,
.procname = "cdrom",
.maxlen = 0,
.mode = 0555,
.child = cdrom_table,
},
{ .ctl_name = 0 }
{ }
};
/* Make sure that /proc/sys/dev is there */
static ctl_table cdrom_root_table[] = {
{
.ctl_name = CTL_DEV,
.procname = "dev",
.maxlen = 0,
.mode = 0555,
.child = cdrom_cdrom_table,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table_header *cdrom_sysctl_header;

View File

@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp)
static ctl_table hpet_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "max-user-freq",
.data = &hpet_max_freq,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{.ctl_name = 0}
{}
};
static ctl_table hpet_root[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "hpet",
.maxlen = 0,
.mode = 0555,
.child = hpet_table,
},
{.ctl_name = 0}
{}
};
static ctl_table dev_root[] = {
{
.ctl_name = CTL_DEV,
.procname = "dev",
.maxlen = 0,
.mode = 0555,
.child = hpet_root,
},
{.ctl_name = 0}
{}
};
static struct ctl_table_header *sysctl_header;

View File

@ -660,26 +660,23 @@ static struct ipmi_smi_watcher smi_watcher = {
#include <linux/sysctl.h>
static ctl_table ipmi_table[] = {
{ .ctl_name = DEV_IPMI_POWEROFF_POWERCYCLE,
.procname = "poweroff_powercycle",
{ .procname = "poweroff_powercycle",
.data = &poweroff_powercycle,
.maxlen = sizeof(poweroff_powercycle),
.mode = 0644,
.proc_handler = &proc_dointvec },
.proc_handler = proc_dointvec },
{ }
};
static ctl_table ipmi_dir_table[] = {
{ .ctl_name = DEV_IPMI,
.procname = "ipmi",
{ .procname = "ipmi",
.mode = 0555,
.child = ipmi_table },
{ }
};
static ctl_table ipmi_root_table[] = {
{ .ctl_name = CTL_DEV,
.procname = "dev",
{ .procname = "dev",
.mode = 0555,
.child = ipmi_dir_table },
{ }

View File

@ -431,30 +431,25 @@ static struct cdev ptmx_cdev;
static struct ctl_table pty_table[] = {
{
.ctl_name = PTY_MAX,
.procname = "max",
.maxlen = sizeof(int),
.mode = 0644,
.data = &pty_limit,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &pty_limit_min,
.extra2 = &pty_limit_max,
}, {
.ctl_name = PTY_NR,
.procname = "nr",
.maxlen = sizeof(int),
.mode = 0444,
.data = &pty_count,
.proc_handler = &proc_dointvec,
}, {
.ctl_name = 0
}
.proc_handler = proc_dointvec,
},
{}
};
static struct ctl_table pty_kern_table[] = {
{
.ctl_name = KERN_PTY,
.procname = "pty",
.mode = 0555,
.child = pty_table,
@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = {
static struct ctl_table pty_root_table[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = pty_kern_table,

View File

@ -1257,94 +1257,54 @@ static int proc_do_uuid(ctl_table *table, int write,
return proc_dostring(&fake_table, write, buffer, lenp, ppos);
}
static int uuid_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
unsigned char tmp_uuid[16], *uuid;
unsigned int len;
if (!oldval || !oldlenp)
return 1;
uuid = table->data;
if (!uuid) {
uuid = tmp_uuid;
uuid[8] = 0;
}
if (uuid[8] == 0)
generate_random_uuid(uuid);
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len > 16)
len = 16;
if (copy_to_user(oldval, uuid, len) ||
put_user(len, oldlenp))
return -EFAULT;
}
return 1;
}
static int sysctl_poolsize = INPUT_POOL_WORDS * 32;
ctl_table random_table[] = {
{
.ctl_name = RANDOM_POOLSIZE,
.procname = "poolsize",
.data = &sysctl_poolsize,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = RANDOM_ENTROPY_COUNT,
.procname = "entropy_avail",
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
.data = &input_pool.entropy_count,
},
{
.ctl_name = RANDOM_READ_THRESH,
.procname = "read_wakeup_threshold",
.data = &random_read_wakeup_thresh,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &min_read_thresh,
.extra2 = &max_read_thresh,
},
{
.ctl_name = RANDOM_WRITE_THRESH,
.procname = "write_wakeup_threshold",
.data = &random_write_wakeup_thresh,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &min_write_thresh,
.extra2 = &max_write_thresh,
},
{
.ctl_name = RANDOM_BOOT_ID,
.procname = "boot_id",
.data = &sysctl_bootid,
.maxlen = 16,
.mode = 0444,
.proc_handler = &proc_do_uuid,
.strategy = &uuid_strategy,
.proc_handler = proc_do_uuid,
},
{
.ctl_name = RANDOM_UUID,
.procname = "uuid",
.maxlen = 16,
.mode = 0444,
.proc_handler = &proc_do_uuid,
.strategy = &uuid_strategy,
.proc_handler = proc_do_uuid,
},
{ .ctl_name = 0 }
{ }
};
#endif /* CONFIG_SYSCTL */

View File

@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id)
*/
static ctl_table rtc_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "max-user-freq",
.data = &rtc_max_user_freq,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table rtc_root[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "rtc",
.mode = 0555,
.child = rtc_table,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table dev_root[] = {
{
.ctl_name = CTL_DEV,
.procname = "dev",
.mode = 0555,
.child = rtc_root,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table_header *sysctl_header;

View File

@ -27,54 +27,49 @@ static int mouse_last_keycode;
/* file(s) in /proc/sys/dev/mac_hid */
static ctl_table mac_hid_files[] = {
{
.ctl_name = DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
.procname = "mouse_button_emulation",
.data = &mouse_emulate_buttons,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
.procname = "mouse_button2_keycode",
.data = &mouse_button2_keycode,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
.procname = "mouse_button3_keycode",
.data = &mouse_button3_keycode,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{ .ctl_name = 0 }
{ }
};
/* dir in /proc/sys/dev */
static ctl_table mac_hid_dir[] = {
{
.ctl_name = DEV_MAC_HID,
.procname = "mac_hid",
.maxlen = 0,
.mode = 0555,
.child = mac_hid_files,
},
{ .ctl_name = 0 }
{ }
};
/* /proc/sys/dev itself, in case that is not there yet */
static ctl_table mac_hid_root_dir[] = {
{
.ctl_name = CTL_DEV,
.procname = "dev",
.maxlen = 0,
.mode = 0555,
.child = mac_hid_dir,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table_header *mac_hid_sysctl_header;

View File

@ -98,44 +98,40 @@ static struct ctl_table_header *raid_table_header;
static ctl_table raid_table[] = {
{
.ctl_name = DEV_RAID_SPEED_LIMIT_MIN,
.procname = "speed_limit_min",
.data = &sysctl_speed_limit_min,
.maxlen = sizeof(int),
.mode = S_IRUGO|S_IWUSR,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = DEV_RAID_SPEED_LIMIT_MAX,
.procname = "speed_limit_max",
.data = &sysctl_speed_limit_max,
.maxlen = sizeof(int),
.mode = S_IRUGO|S_IWUSR,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table raid_dir_table[] = {
{
.ctl_name = DEV_RAID,
.procname = "raid",
.maxlen = 0,
.mode = S_IRUGO|S_IXUGO,
.child = raid_table,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table raid_root_table[] = {
{
.ctl_name = CTL_DEV,
.procname = "dev",
.maxlen = 0,
.mode = 0555,
.child = raid_dir_table,
},
{ .ctl_name = 0 }
{ }
};
static const struct block_device_operations md_fops;

View File

@ -89,48 +89,40 @@ static int xpc_disengage_max_timelimit = 120;
static ctl_table xpc_sys_xpc_hb_dir[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "hb_interval",
.data = &xpc_hb_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_hb_min_interval,
.extra2 = &xpc_hb_max_interval},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "hb_check_interval",
.data = &xpc_hb_check_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_hb_check_min_interval,
.extra2 = &xpc_hb_check_max_interval},
{}
};
static ctl_table xpc_sys_xpc_dir[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "hb",
.mode = 0555,
.child = xpc_sys_xpc_hb_dir},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "disengage_timelimit",
.data = &xpc_disengage_timelimit,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_disengage_min_timelimit,
.extra2 = &xpc_disengage_max_timelimit},
{}
};
static ctl_table xpc_sys_dir[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "xpc",
.mode = 0555,
.child = xpc_sys_xpc_dir},

View File

@ -816,84 +816,83 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write,
/* Place files in /proc/sys/dev/arlan */
#define CTBLN(num,card,nam) \
{ .ctl_name = num,\
.procname = #nam,\
#define CTBLN(card,nam) \
{ .procname = #nam,\
.data = &(arlan_conf[card].nam),\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}
.maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec}
#ifdef ARLAN_DEBUGGING
#define ARLAN_PROC_DEBUG_ENTRIES \
{ .ctl_name = 48, .procname = "entry_exit_debug",\
{ .procname = "entry_exit_debug",\
.data = &arlan_entry_and_exit_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\
{ .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},
.maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec},\
{ .procname = "debug", .data = &arlan_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec},
#else
#define ARLAN_PROC_DEBUG_ENTRIES
#endif
#define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
CTBLN(1,cardNo,spreadingCode),\
CTBLN(2,cardNo, channelNumber),\
CTBLN(3,cardNo, scramblingDisable),\
CTBLN(4,cardNo, txAttenuation),\
CTBLN(5,cardNo, systemId), \
CTBLN(6,cardNo, maxDatagramSize),\
CTBLN(7,cardNo, maxFrameSize),\
CTBLN(8,cardNo, maxRetries),\
CTBLN(9,cardNo, receiveMode),\
CTBLN(10,cardNo, priority),\
CTBLN(11,cardNo, rootOrRepeater),\
CTBLN(12,cardNo, SID),\
CTBLN(13,cardNo, registrationMode),\
CTBLN(14,cardNo, registrationFill),\
CTBLN(15,cardNo, localTalkAddress),\
CTBLN(16,cardNo, codeFormat),\
CTBLN(17,cardNo, numChannels),\
CTBLN(18,cardNo, channel1),\
CTBLN(19,cardNo, channel2),\
CTBLN(20,cardNo, channel3),\
CTBLN(21,cardNo, channel4),\
CTBLN(22,cardNo, txClear),\
CTBLN(23,cardNo, txRetries),\
CTBLN(24,cardNo, txRouting),\
CTBLN(25,cardNo, txScrambled),\
CTBLN(26,cardNo, rxParameter),\
CTBLN(27,cardNo, txTimeoutMs),\
CTBLN(28,cardNo, waitCardTimeout),\
CTBLN(29,cardNo, channelSet), \
{.ctl_name = 30, .procname = "name",\
CTBLN(cardNo,spreadingCode),\
CTBLN(cardNo, channelNumber),\
CTBLN(cardNo, scramblingDisable),\
CTBLN(cardNo, txAttenuation),\
CTBLN(cardNo, systemId), \
CTBLN(cardNo, maxDatagramSize),\
CTBLN(cardNo, maxFrameSize),\
CTBLN(cardNo, maxRetries),\
CTBLN(cardNo, receiveMode),\
CTBLN(cardNo, priority),\
CTBLN(cardNo, rootOrRepeater),\
CTBLN(cardNo, SID),\
CTBLN(cardNo, registrationMode),\
CTBLN(cardNo, registrationFill),\
CTBLN(cardNo, localTalkAddress),\
CTBLN(cardNo, codeFormat),\
CTBLN(cardNo, numChannels),\
CTBLN(cardNo, channel1),\
CTBLN(cardNo, channel2),\
CTBLN(cardNo, channel3),\
CTBLN(cardNo, channel4),\
CTBLN(cardNo, txClear),\
CTBLN(cardNo, txRetries),\
CTBLN(cardNo, txRouting),\
CTBLN(cardNo, txScrambled),\
CTBLN(cardNo, rxParameter),\
CTBLN(cardNo, txTimeoutMs),\
CTBLN(cardNo, waitCardTimeout),\
CTBLN(cardNo, channelSet), \
{ .procname = "name",\
.data = arlan_conf[cardNo].siteName,\
.maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\
CTBLN(31,cardNo,waitTime),\
CTBLN(32,cardNo,lParameter),\
CTBLN(33,cardNo,_15),\
CTBLN(34,cardNo,headerSize),\
CTBLN(36,cardNo,tx_delay_ms),\
CTBLN(37,cardNo,retries),\
CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\
CTBLN(40,cardNo,fastReTransCount),\
CTBLN(41,cardNo,driverRetransmissions),\
CTBLN(42,cardNo,txAckTimeoutMs),\
CTBLN(43,cardNo,registrationInterrupts),\
CTBLN(44,cardNo,hardwareType),\
CTBLN(45,cardNo,radioType),\
CTBLN(46,cardNo,writeEEPROM),\
CTBLN(47,cardNo,writeRadioType),\
.maxlen = 16, .mode = 0600, .proc_handler = proc_dostring},\
CTBLN(cardNo,waitTime),\
CTBLN(cardNo,lParameter),\
CTBLN(cardNo,_15),\
CTBLN(cardNo,headerSize),\
CTBLN(cardNo,tx_delay_ms),\
CTBLN(cardNo,retries),\
CTBLN(cardNo,ReTransmitPacketMaxSize),\
CTBLN(cardNo,waitReTransmitPacketMaxSize),\
CTBLN(cardNo,fastReTransCount),\
CTBLN(cardNo,driverRetransmissions),\
CTBLN(cardNo,txAckTimeoutMs),\
CTBLN(cardNo,registrationInterrupts),\
CTBLN(cardNo,hardwareType),\
CTBLN(cardNo,radioType),\
CTBLN(cardNo,writeEEPROM),\
CTBLN(cardNo,writeRadioType),\
ARLAN_PROC_DEBUG_ENTRIES\
CTBLN(50,cardNo,in_speed),\
CTBLN(51,cardNo,out_speed),\
CTBLN(52,cardNo,in_speed10),\
CTBLN(53,cardNo,out_speed10),\
CTBLN(54,cardNo,in_speed_max),\
CTBLN(55,cardNo,out_speed_max),\
CTBLN(56,cardNo,measure_rate),\
CTBLN(57,cardNo,pre_Command_Wait),\
CTBLN(58,cardNo,rx_tweak1),\
CTBLN(59,cardNo,rx_tweak2),\
CTBLN(60,cardNo,tx_queue_len),\
CTBLN(cardNo,in_speed),\
CTBLN(cardNo,out_speed),\
CTBLN(cardNo,in_speed10),\
CTBLN(cardNo,out_speed10),\
CTBLN(cardNo,in_speed_max),\
CTBLN(cardNo,out_speed_max),\
CTBLN(cardNo,measure_rate),\
CTBLN(cardNo,pre_Command_Wait),\
CTBLN(cardNo,rx_tweak1),\
CTBLN(cardNo,rx_tweak2),\
CTBLN(cardNo,tx_queue_len),\
@ -903,63 +902,56 @@ static ctl_table arlan_conf_table0[] =
#ifdef ARLAN_PROC_SHM_DUMP
{
.ctl_name = 150,
.procname = "arlan0-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
.proc_handler = arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan0-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
.proc_handler = arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan0-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
.proc_handler = arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan0-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
.proc_handler = arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan0-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
.proc_handler = arlan_sysctl_info,
},
#endif
{
.ctl_name = 155,
.procname = "config0",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure
.proc_handler = arlan_configure
},
{
.ctl_name = 156,
.procname = "reset0",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
.proc_handler = arlan_sysctl_reset,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table arlan_conf_table1[] =
@ -969,63 +961,56 @@ static ctl_table arlan_conf_table1[] =
#ifdef ARLAN_PROC_SHM_DUMP
{
.ctl_name = 150,
.procname = "arlan1-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
.proc_handler = arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan1-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
.proc_handler = arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan1-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
.proc_handler = arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan1-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
.proc_handler = arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan1-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
.proc_handler = arlan_sysctl_info,
},
#endif
{
.ctl_name = 155,
.procname = "config1",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure,
.proc_handler = arlan_configure,
},
{
.ctl_name = 156,
.procname = "reset1",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
.proc_handler = arlan_sysctl_reset,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table arlan_conf_table2[] =
@ -1035,63 +1020,56 @@ static ctl_table arlan_conf_table2[] =
#ifdef ARLAN_PROC_SHM_DUMP
{
.ctl_name = 150,
.procname = "arlan2-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
.proc_handler = arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan2-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
.proc_handler = arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan2-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
.proc_handler = arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan2-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
.proc_handler = arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan2-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
.proc_handler = arlan_sysctl_info,
},
#endif
{
.ctl_name = 155,
.procname = "config2",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure,
.proc_handler = arlan_configure,
},
{
.ctl_name = 156,
.procname = "reset2",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
.proc_handler = arlan_sysctl_reset,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table arlan_conf_table3[] =
@ -1101,63 +1079,56 @@ static ctl_table arlan_conf_table3[] =
#ifdef ARLAN_PROC_SHM_DUMP
{
.ctl_name = 150,
.procname = "arlan3-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
.proc_handler = arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan3-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
.proc_handler = arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan3-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
.proc_handler = arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan3-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
.proc_handler = arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan3-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
.proc_handler = arlan_sysctl_info,
},
#endif
{
.ctl_name = 155,
.procname = "config3",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure,
.proc_handler = arlan_configure,
},
{
.ctl_name = 156,
.procname = "reset3",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
.proc_handler = arlan_sysctl_reset,
},
{ .ctl_name = 0 }
{ }
};
@ -1165,41 +1136,37 @@ static ctl_table arlan_conf_table3[] =
static ctl_table arlan_table[] =
{
{
.ctl_name = 0,
.procname = "arlan0",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table0,
},
{
.ctl_name = 0,
.procname = "arlan1",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table1,
},
{
.ctl_name = 0,
.procname = "arlan2",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table2,
},
{
.ctl_name = 0,
.procname = "arlan3",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table3,
},
{ .ctl_name = 0 }
{ }
};
#else
static ctl_table arlan_table[MAX_ARLANS + 1] =
static ctl_table arlan_table[] =
{
{ .ctl_name = 0 }
{ }
};
#endif
@ -1209,22 +1176,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] =
static ctl_table arlan_root_table[] =
{
{
.ctl_name = CTL_ARLAN,
.procname = "arlan",
.maxlen = 0,
.mode = 0555,
.child = arlan_table,
},
{ .ctl_name = 0 }
{ }
};
/* Make sure that /proc/sys/dev is there */
//static ctl_table arlan_device_root_table[] =
//{
// {CTL_DEV, "dev", NULL, 0, 0555, arlan_root_table},
// {0}
//};
static struct ctl_table_header *arlan_device_sysctl_header;
@ -1234,8 +1193,6 @@ int __init init_arlan_proc(void)
int i = 0;
if (arlan_device_sysctl_header)
return 0;
for (i = 0; i < MAX_ARLANS && arlan_device[i]; i++)
arlan_table[i].ctl_name = i + 1;
arlan_device_sysctl_header = register_sysctl_table(arlan_root_table);
if (!arlan_device_sysctl_header)
return -1;

View File

@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write,
return copy_to_user(result, buffer, len) ? -EFAULT : 0;
}
#define PARPORT_PORT_DIR(CHILD) { .ctl_name = 0, .procname = NULL, .mode = 0555, .child = CHILD }
#define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \
#define PARPORT_PORT_DIR(CHILD) { .procname = NULL, .mode = 0555, .child = CHILD }
#define PARPORT_PARPORT_DIR(CHILD) { .procname = "parport", \
.mode = 0555, .child = CHILD }
#define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD }
#define PARPORT_DEV_DIR(CHILD) { .procname = "dev", .mode = 0555, .child = CHILD }
#define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \
.mode = 0555, .child = NULL }
@ -270,7 +270,7 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.proc_handler = proc_dointvec_minmax,
.extra1 = (void*) &parport_min_spintime_value,
.extra2 = (void*) &parport_max_spintime_value
},
@ -279,28 +279,28 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_hardware_base_addr
.proc_handler = do_hardware_base_addr
},
{
.procname = "irq",
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_hardware_irq
.proc_handler = do_hardware_irq
},
{
.procname = "dma",
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_hardware_dma
.proc_handler = do_hardware_dma
},
{
.procname = "modes",
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_hardware_modes
.proc_handler = do_hardware_modes
},
PARPORT_DEVICES_ROOT_DIR,
#ifdef CONFIG_PARPORT_1284
@ -309,35 +309,35 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_autoprobe
.proc_handler = do_autoprobe
},
{
.procname = "autoprobe0",
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_autoprobe
.proc_handler = do_autoprobe
},
{
.procname = "autoprobe1",
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_autoprobe
.proc_handler = do_autoprobe
},
{
.procname = "autoprobe2",
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_autoprobe
.proc_handler = do_autoprobe
},
{
.procname = "autoprobe3",
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_autoprobe
.proc_handler = do_autoprobe
},
#endif /* IEEE 1284 support */
{}
@ -348,7 +348,7 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL,
.maxlen = 0,
.mode = 0444,
.proc_handler = &do_active_device
.proc_handler = do_active_device
},
{}
},
@ -386,14 +386,13 @@ parport_device_sysctl_template = {
.data = NULL,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = &proc_doulongvec_ms_jiffies_minmax,
.proc_handler = proc_doulongvec_ms_jiffies_minmax,
.extra1 = (void*) &parport_min_timeslice_value,
.extra2 = (void*) &parport_max_timeslice_value
},
},
{
{
.ctl_name = 0,
.procname = NULL,
.data = NULL,
.maxlen = 0,
@ -438,7 +437,7 @@ parport_default_sysctl_table = {
.data = &parport_default_timeslice,
.maxlen = sizeof(parport_default_timeslice),
.mode = 0644,
.proc_handler = &proc_doulongvec_ms_jiffies_minmax,
.proc_handler = proc_doulongvec_ms_jiffies_minmax,
.extra1 = (void*) &parport_min_timeslice_value,
.extra2 = (void*) &parport_max_timeslice_value
},
@ -447,7 +446,7 @@ parport_default_sysctl_table = {
.data = &parport_default_spintime,
.maxlen = sizeof(parport_default_spintime),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.proc_handler = proc_dointvec_minmax,
.extra1 = (void*) &parport_min_spintime_value,
.extra2 = (void*) &parport_max_spintime_value
},
@ -455,7 +454,6 @@ parport_default_sysctl_table = {
},
{
{
.ctl_name = DEV_PARPORT_DEFAULT,
.procname = "default",
.mode = 0555,
.child = parport_default_sysctl_table.vars
@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port)
t->vars[6 + i].extra2 = &port->probe_info[i];
t->port_dir[0].procname = port->name;
t->port_dir[0].ctl_name = 0;
t->port_dir[0].child = t->vars;
t->parport_dir[0].child = t->port_dir;
@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device)
t->dev_dir[0].child = t->parport_dir;
t->parport_dir[0].child = t->port_dir;
t->port_dir[0].procname = port->name;
t->port_dir[0].ctl_name = 0;
t->port_dir[0].child = t->devices_root_dir;
t->devices_root_dir[0].child = t->device_dir;
t->device_dir[0].ctl_name = 0;
t->device_dir[0].procname = device->name;
t->device_dir[0].child = t->vars;
t->vars[0].data = &device->timeslice;

View File

@ -101,18 +101,17 @@ static struct ctl_table callhome_table[] = {
.mode = 0644,
.proc_handler = proc_handler_callhome,
},
{ .ctl_name = 0 }
{}
};
static struct ctl_table kern_dir_table[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.maxlen = 0,
.mode = 0555,
.child = callhome_table,
},
{ .ctl_name = 0 }
{}
};
/*

View File

@ -13,26 +13,23 @@
static ctl_table scsi_table[] = {
{ .ctl_name = DEV_SCSI_LOGGING_LEVEL,
.procname = "logging_level",
{ .procname = "logging_level",
.data = &scsi_logging_level,
.maxlen = sizeof(scsi_logging_level),
.mode = 0644,
.proc_handler = &proc_dointvec },
.proc_handler = proc_dointvec },
{ }
};
static ctl_table scsi_dir_table[] = {
{ .ctl_name = DEV_SCSI,
.procname = "scsi",
{ .procname = "scsi",
.mode = 0555,
.child = scsi_table },
{ }
};
static ctl_table scsi_root_table[] = {
{ .ctl_name = CTL_DEV,
.procname = "dev",
{ .procname = "dev",
.mode = 0555,
.child = scsi_dir_table },
{ }

View File

@ -17,28 +17,25 @@ static struct ctl_table_header *fs_table_header;
static ctl_table coda_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "timeout",
.data = &coda_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
.proc_handler = proc_dointvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "hard",
.data = &coda_hard,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
.proc_handler = proc_dointvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "fake_statfs",
.data = &coda_fake_statfs,
.maxlen = sizeof(int),
.mode = 0600,
.proc_handler = &proc_dointvec
.proc_handler = proc_dointvec
},
{}
};
@ -46,7 +43,6 @@ static ctl_table coda_table[] = {
#ifdef CONFIG_SYSCTL
static ctl_table fs_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "coda",
.mode = 0555,
.child = coda_table

View File

@ -251,10 +251,10 @@ ctl_table epoll_table[] = {
.data = &max_user_watches,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
},
{ .ctl_name = 0 }
{ }
};
#endif /* CONFIG_SYSCTL */

View File

@ -371,82 +371,74 @@ EXPORT_SYMBOL_GPL(lockd_down);
static ctl_table nlm_sysctls[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_grace_period",
.data = &nlm_grace_period,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
.proc_handler = proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_grace_period_min,
.extra2 = (unsigned long *) &nlm_grace_period_max,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_timeout",
.data = &nlm_timeout,
.maxlen = sizeof(unsigned long),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
.proc_handler = proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_timeout_min,
.extra2 = (unsigned long *) &nlm_timeout_max,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_udpport",
.data = &nlm_udpport,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.proc_handler = proc_dointvec_minmax,
.extra1 = (int *) &nlm_port_min,
.extra2 = (int *) &nlm_port_max,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_tcpport",
.data = &nlm_tcpport,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.proc_handler = proc_dointvec_minmax,
.extra1 = (int *) &nlm_port_min,
.extra2 = (int *) &nlm_port_max,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nsm_use_hostnames",
.data = &nsm_use_hostnames,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nsm_local_state",
.data = &nsm_local_state,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table nlm_sysctl_dir[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs",
.mode = 0555,
.child = nlm_sysctls,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table nlm_sysctl_root[] = {
{
.ctl_name = CTL_FS,
.procname = "fs",
.mode = 0555,
.child = nlm_sysctl_dir,
},
{ .ctl_name = 0 }
{ }
};
#endif /* CONFIG_SYSCTL */

View File

@ -22,63 +22,55 @@ static struct ctl_table_header *nfs_callback_sysctl_table;
static ctl_table nfs_cb_sysctls[] = {
#ifdef CONFIG_NFS_V4
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs_callback_tcpport",
.data = &nfs_callback_set_tcpport,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.proc_handler = proc_dointvec_minmax,
.extra1 = (int *)&nfs_set_port_min,
.extra2 = (int *)&nfs_set_port_max,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "idmap_cache_timeout",
.data = &nfs_idmap_cache_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies,
.proc_handler = proc_dointvec_jiffies,
},
#endif
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs_mountpoint_timeout",
.data = &nfs_mountpoint_expiry_timeout,
.maxlen = sizeof(nfs_mountpoint_expiry_timeout),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies,
.proc_handler = proc_dointvec_jiffies,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs_congestion_kb",
.data = &nfs_congestion_kb,
.maxlen = sizeof(nfs_congestion_kb),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table nfs_cb_sysctl_dir[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs",
.mode = 0555,
.child = nfs_cb_sysctls,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table nfs_cb_sysctl_root[] = {
{
.ctl_name = CTL_FS,
.procname = "fs",
.mode = 0555,
.child = nfs_cb_sysctl_dir,
},
{ .ctl_name = 0 }
{ }
};
int nfs_register_sysctl(void)

View File

@ -69,36 +69,30 @@ static int zero;
ctl_table inotify_table[] = {
{
.ctl_name = INOTIFY_MAX_USER_INSTANCES,
.procname = "max_user_instances",
.data = &inotify_max_user_instances,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
},
{
.ctl_name = INOTIFY_MAX_USER_WATCHES,
.procname = "max_user_watches",
.data = &inotify_max_user_watches,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
},
{
.ctl_name = INOTIFY_MAX_QUEUED_EVENTS,
.procname = "max_queued_events",
.data = &inotify_max_queued_events,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero
},
{ .ctl_name = 0 }
{ }
};
#endif /* CONFIG_SYSCTL */

View File

@ -36,12 +36,11 @@
/* Definition of the ntfs sysctl. */
static ctl_table ntfs_sysctls[] = {
{
.ctl_name = CTL_UNNUMBERED, /* Binary and text IDs. */
.procname = "ntfs-debug",
.data = &debug_msgs, /* Data pointer and size. */
.maxlen = sizeof(debug_msgs),
.mode = 0644, /* Mode, proc handler. */
.proc_handler = &proc_dointvec
.proc_handler = proc_dointvec
},
{}
};
@ -49,7 +48,6 @@ static ctl_table ntfs_sysctls[] = {
/* Define the parent directory /proc/sys/fs. */
static ctl_table sysctls_root[] = {
{
.ctl_name = CTL_FS,
.procname = "fs",
.mode = 0555,
.child = ntfs_sysctls

View File

@ -620,51 +620,46 @@ error:
static ctl_table ocfs2_nm_table[] = {
{
.ctl_name = 1,
.procname = "hb_ctl_path",
.data = ocfs2_hb_ctl_path,
.maxlen = OCFS2_MAX_HB_CTL_PATH,
.mode = 0644,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string,
.proc_handler = proc_dostring,
},
{ .ctl_name = 0 }
{ }
};
static ctl_table ocfs2_mod_table[] = {
{
.ctl_name = FS_OCFS2_NM,
.procname = "nm",
.data = NULL,
.maxlen = 0,
.mode = 0555,
.child = ocfs2_nm_table
},
{ .ctl_name = 0}
{ }
};
static ctl_table ocfs2_kern_table[] = {
{
.ctl_name = FS_OCFS2,
.procname = "ocfs2",
.data = NULL,
.maxlen = 0,
.mode = 0555,
.child = ocfs2_mod_table
},
{ .ctl_name = 0}
{ }
};
static ctl_table ocfs2_root_table[] = {
{
.ctl_name = CTL_FS,
.procname = "fs",
.data = NULL,
.maxlen = 0,
.mode = 0555,
.child = ocfs2_kern_table
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table_header *ocfs2_table_header = NULL;

View File

@ -48,7 +48,7 @@ out:
static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name)
{
int len;
for ( ; p->ctl_name || p->procname; p++) {
for ( ; p->procname; p++) {
if (!p->procname)
continue;
@ -218,7 +218,7 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
void *dirent, filldir_t filldir)
{
for (; table->ctl_name || table->procname; table++, (*pos)++) {
for (; table->procname; table++, (*pos)++) {
int res;
/* Can't do anything without a proc name */

View File

@ -2404,100 +2404,89 @@ const struct quotactl_ops vfs_quotactl_ops = {
static ctl_table fs_dqstats_table[] = {
{
.ctl_name = FS_DQ_LOOKUPS,
.procname = "lookups",
.data = &dqstats.lookups,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = FS_DQ_DROPS,
.procname = "drops",
.data = &dqstats.drops,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = FS_DQ_READS,
.procname = "reads",
.data = &dqstats.reads,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = FS_DQ_WRITES,
.procname = "writes",
.data = &dqstats.writes,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = FS_DQ_CACHE_HITS,
.procname = "cache_hits",
.data = &dqstats.cache_hits,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = FS_DQ_ALLOCATED,
.procname = "allocated_dquots",
.data = &dqstats.allocated_dquots,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = FS_DQ_FREE,
.procname = "free_dquots",
.data = &dqstats.free_dquots,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
{
.ctl_name = FS_DQ_SYNCS,
.procname = "syncs",
.data = &dqstats.syncs,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
#ifdef CONFIG_PRINT_QUOTA_WARNING
{
.ctl_name = FS_DQ_WARNINGS,
.procname = "warnings",
.data = &flag_print_warnings,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
},
#endif
{ .ctl_name = 0 },
{ },
};
static ctl_table fs_table[] = {
{
.ctl_name = FS_DQSTATS,
.procname = "quota",
.mode = 0555,
.child = fs_dqstats_table,
},
{ .ctl_name = 0 },
{ },
};
static ctl_table sys_table[] = {
{
.ctl_name = CTL_FS,
.procname = "fs",
.mode = 0555,
.child = fs_table,
},
{ .ctl_name = 0 },
{ },
};
static int __init dquot_init(void)

View File

@ -55,170 +55,140 @@ xfs_stats_clear_proc_handler(
static ctl_table xfs_table[] = {
{
.ctl_name = XFS_SGID_INHERIT,
.procname = "irix_sgid_inherit",
.data = &xfs_params.sgid_inherit.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.sgid_inherit.min,
.extra2 = &xfs_params.sgid_inherit.max
},
{
.ctl_name = XFS_SYMLINK_MODE,
.procname = "irix_symlink_mode",
.data = &xfs_params.symlink_mode.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.symlink_mode.min,
.extra2 = &xfs_params.symlink_mode.max
},
{
.ctl_name = XFS_PANIC_MASK,
.procname = "panic_mask",
.data = &xfs_params.panic_mask.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.panic_mask.min,
.extra2 = &xfs_params.panic_mask.max
},
{
.ctl_name = XFS_ERRLEVEL,
.procname = "error_level",
.data = &xfs_params.error_level.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.error_level.min,
.extra2 = &xfs_params.error_level.max
},
{
.ctl_name = XFS_SYNCD_TIMER,
.procname = "xfssyncd_centisecs",
.data = &xfs_params.syncd_timer.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.syncd_timer.min,
.extra2 = &xfs_params.syncd_timer.max
},
{
.ctl_name = XFS_INHERIT_SYNC,
.procname = "inherit_sync",
.data = &xfs_params.inherit_sync.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.inherit_sync.min,
.extra2 = &xfs_params.inherit_sync.max
},
{
.ctl_name = XFS_INHERIT_NODUMP,
.procname = "inherit_nodump",
.data = &xfs_params.inherit_nodump.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.inherit_nodump.min,
.extra2 = &xfs_params.inherit_nodump.max
},
{
.ctl_name = XFS_INHERIT_NOATIME,
.procname = "inherit_noatime",
.data = &xfs_params.inherit_noatim.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.inherit_noatim.min,
.extra2 = &xfs_params.inherit_noatim.max
},
{
.ctl_name = XFS_BUF_TIMER,
.procname = "xfsbufd_centisecs",
.data = &xfs_params.xfs_buf_timer.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.xfs_buf_timer.min,
.extra2 = &xfs_params.xfs_buf_timer.max
},
{
.ctl_name = XFS_BUF_AGE,
.procname = "age_buffer_centisecs",
.data = &xfs_params.xfs_buf_age.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.xfs_buf_age.min,
.extra2 = &xfs_params.xfs_buf_age.max
},
{
.ctl_name = XFS_INHERIT_NOSYM,
.procname = "inherit_nosymlinks",
.data = &xfs_params.inherit_nosym.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.inherit_nosym.min,
.extra2 = &xfs_params.inherit_nosym.max
},
{
.ctl_name = XFS_ROTORSTEP,
.procname = "rotorstep",
.data = &xfs_params.rotorstep.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.rotorstep.min,
.extra2 = &xfs_params.rotorstep.max
},
{
.ctl_name = XFS_INHERIT_NODFRG,
.procname = "inherit_nodefrag",
.data = &xfs_params.inherit_nodfrg.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.inherit_nodfrg.min,
.extra2 = &xfs_params.inherit_nodfrg.max
},
{
.ctl_name = XFS_FILESTREAM_TIMER,
.procname = "filestream_centisecs",
.data = &xfs_params.fstrm_timer.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xfs_params.fstrm_timer.min,
.extra2 = &xfs_params.fstrm_timer.max,
},
/* please keep this the last entry */
#ifdef CONFIG_PROC_FS
{
.ctl_name = XFS_STATS_CLEAR,
.procname = "stats_clear",
.data = &xfs_params.stats_clear.val,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &xfs_stats_clear_proc_handler,
.strategy = &sysctl_intvec,
.proc_handler = xfs_stats_clear_proc_handler,
.extra1 = &xfs_params.stats_clear.min,
.extra2 = &xfs_params.stats_clear.max
},
@ -229,7 +199,6 @@ static ctl_table xfs_table[] = {
static ctl_table xfs_dir_table[] = {
{
.ctl_name = FS_XFS,
.procname = "xfs",
.mode = 0555,
.child = xfs_table
@ -239,7 +208,6 @@ static ctl_table xfs_dir_table[] = {
static ctl_table xfs_root_table[] = {
{
.ctl_name = CTL_FS,
.procname = "fs",
.mode = 0555,
.child = xfs_dir_table

View File

@ -15,9 +15,6 @@
** The kernel will then return -ENOTDIR to any application using
** the old binary interface.
**
** For new interfaces unless you really need a binary number
** please use CTL_UNNUMBERED.
**
****************************************************************
****************************************************************
*/
@ -50,12 +47,6 @@ struct __sysctl_args {
/* Top-level names: */
/* For internal pattern-matching use only: */
#ifdef __KERNEL__
#define CTL_NONE 0
#define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */
#endif
enum
{
CTL_KERN=1, /* General kernel info and control */
@ -972,10 +963,6 @@ extern int sysctl_perm(struct ctl_table_root *root,
typedef struct ctl_table ctl_table;
typedef int ctl_handler (struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen);
typedef int proc_handler (struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
@ -996,21 +983,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
void __user *, size_t *, loff_t *);
extern int do_sysctl (int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen);
extern ctl_handler sysctl_data;
extern ctl_handler sysctl_string;
extern ctl_handler sysctl_intvec;
extern ctl_handler sysctl_jiffies;
extern ctl_handler sysctl_ms_jiffies;
/*
* Register a set of sysctl names by calling register_sysctl_table
* with an initialised array of struct ctl_table's. An entry with zero
* ctl_name and NULL procname terminates the table. table->de will be
* with an initialised array of struct ctl_table's. An entry with
* NULL procname terminates the table. table->de will be
* set up by the registration and need not be initialised in advance.
*
* sysctl names can be mirrored automatically under /proc/sys. The
@ -1023,24 +999,11 @@ extern ctl_handler sysctl_ms_jiffies;
* under /proc; non-leaf nodes will be represented by directories. A
* null procname disables /proc mirroring at this node.
*
* sysctl entries with a zero ctl_name will not be available through
* the binary sysctl interface.
*
* sysctl(2) can automatically manage read and write requests through
* the sysctl table. The data and maxlen fields of the ctl_table
* struct enable minimal validation of the values being written to be
* performed, and the mode field allows minimal authentication.
*
* More sophisticated management can be enabled by the provision of a
* strategy routine with the table entry. This will be called before
* any automatic read or write of the data is performed.
*
* The strategy routine may return:
* <0: Error occurred (error is passed to user process)
* 0: OK - proceed with automatic read or write.
* >0: OK - read or write has been done by the strategy routine, so
* return immediately.
*
* There must be a proc_handler routine for any terminal nodes
* mirrored under /proc/sys (non-terminals are handled by a built-in
* directory handler). Several default handlers are available to
@ -1050,7 +1013,6 @@ extern ctl_handler sysctl_ms_jiffies;
/* A sysctl table is an array of struct ctl_table: */
struct ctl_table
{
int ctl_name; /* Binary ID */
const char *procname; /* Text ID for /proc/sys, or zero */
void *data;
int maxlen;
@ -1058,7 +1020,6 @@ struct ctl_table
struct ctl_table *child;
struct ctl_table *parent; /* Automatically set */
proc_handler *proc_handler; /* Callback for text formatting */
ctl_handler *strategy; /* Callback function for all r/w */
void *extra1;
void *extra2;
};
@ -1092,7 +1053,6 @@ struct ctl_table_header
/* struct ctl_path describes where in the hierarchy a table is added */
struct ctl_path {
const char *procname;
int ctl_name;
};
void register_sysctl_root(struct ctl_table_root *root);

View File

@ -75,7 +75,6 @@ struct dn_dev_parms {
unsigned long t3; /* Default value of t3 */
int priority; /* Priority to be a router */
char *name; /* Name for sysctl */
int ctl_name; /* Index for sysctl */
int (*up)(struct net_device *);
void (*down)(struct net_device *);
void (*timer3)(struct net_device *, struct dn_ifaddr *ifa);

View File

@ -264,8 +264,7 @@ extern int neigh_sysctl_register(struct net_device *dev,
struct neigh_parms *p,
int p_id, int pdev_id,
char *p_name,
proc_handler *proc_handler,
ctl_handler *strategy);
proc_handler *proc_handler);
extern void neigh_sysctl_unregister(struct neigh_parms *p);
static inline void __neigh_parms_put(struct neigh_parms *parms)

View File

@ -763,6 +763,7 @@ config UID16
config SYSCTL_SYSCALL
bool "Sysctl syscall support" if EMBEDDED
depends on PROC_SYSCTL
default y
select SYSCTL
---help---

View File

@ -129,136 +129,60 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
#define proc_ipcauto_dointvec_minmax NULL
#endif
#ifdef CONFIG_SYSCTL_SYSCALL
/* The generic sysctl ipc data routine. */
static int sysctl_ipc_data(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
size_t len;
void *data;
/* Get out of I don't have a variable */
if (!table->data || !table->maxlen)
return -ENOTDIR;
data = get_ipc(table);
if (!data)
return -ENOTDIR;
if (oldval && oldlenp) {
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len > table->maxlen)
len = table->maxlen;
if (copy_to_user(oldval, data, len))
return -EFAULT;
if (put_user(len, oldlenp))
return -EFAULT;
}
}
if (newval && newlen) {
if (newlen > table->maxlen)
newlen = table->maxlen;
if (copy_from_user(data, newval, newlen))
return -EFAULT;
}
return 1;
}
static int sysctl_ipc_registered_data(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
int rc;
rc = sysctl_ipc_data(table, oldval, oldlenp, newval, newlen);
if (newval && newlen && rc > 0)
/*
* Tunable has successfully been changed from userland
*/
unregister_ipcns_notifier(current->nsproxy->ipc_ns);
return rc;
}
#else
#define sysctl_ipc_data NULL
#define sysctl_ipc_registered_data NULL
#endif
static int zero;
static int one = 1;
static struct ctl_table ipc_kern_table[] = {
{
.ctl_name = KERN_SHMMAX,
.procname = "shmmax",
.data = &init_ipc_ns.shm_ctlmax,
.maxlen = sizeof (init_ipc_ns.shm_ctlmax),
.mode = 0644,
.proc_handler = proc_ipc_doulongvec_minmax,
.strategy = sysctl_ipc_data,
},
{
.ctl_name = KERN_SHMALL,
.procname = "shmall",
.data = &init_ipc_ns.shm_ctlall,
.maxlen = sizeof (init_ipc_ns.shm_ctlall),
.mode = 0644,
.proc_handler = proc_ipc_doulongvec_minmax,
.strategy = sysctl_ipc_data,
},
{
.ctl_name = KERN_SHMMNI,
.procname = "shmmni",
.data = &init_ipc_ns.shm_ctlmni,
.maxlen = sizeof (init_ipc_ns.shm_ctlmni),
.mode = 0644,
.proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
},
{
.ctl_name = KERN_MSGMAX,
.procname = "msgmax",
.data = &init_ipc_ns.msg_ctlmax,
.maxlen = sizeof (init_ipc_ns.msg_ctlmax),
.mode = 0644,
.proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
},
{
.ctl_name = KERN_MSGMNI,
.procname = "msgmni",
.data = &init_ipc_ns.msg_ctlmni,
.maxlen = sizeof (init_ipc_ns.msg_ctlmni),
.mode = 0644,
.proc_handler = proc_ipc_callback_dointvec,
.strategy = sysctl_ipc_registered_data,
},
{
.ctl_name = KERN_MSGMNB,
.procname = "msgmnb",
.data = &init_ipc_ns.msg_ctlmnb,
.maxlen = sizeof (init_ipc_ns.msg_ctlmnb),
.mode = 0644,
.proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
},
{
.ctl_name = KERN_SEM,
.procname = "sem",
.data = &init_ipc_ns.sem_ctls,
.maxlen = 4*sizeof (int),
.mode = 0644,
.proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "auto_msgmni",
.data = &init_ipc_ns.auto_msgmni,
.maxlen = sizeof(int),
@ -272,7 +196,6 @@ static struct ctl_table ipc_kern_table[] = {
static struct ctl_table ipc_root_table[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = ipc_kern_table,

View File

@ -88,7 +88,7 @@ static ctl_table mq_sysctls[] = {
.extra1 = &msg_maxsize_limit_min,
.extra2 = &msg_maxsize_limit_max,
},
{ .ctl_name = 0 }
{}
};
static ctl_table mq_sysctl_dir[] = {
@ -97,17 +97,16 @@ static ctl_table mq_sysctl_dir[] = {
.mode = 0555,
.child = mq_sysctls,
},
{ .ctl_name = 0 }
{}
};
static ctl_table mq_sysctl_root[] = {
{
.ctl_name = CTL_FS,
.procname = "fs",
.mode = 0555,
.child = mq_sysctl_dir,
},
{ .ctl_name = 0 }
{}
};
struct ctl_table_header *mq_register_sysctl_table(void)

View File

@ -4,7 +4,7 @@
obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
cpu.o exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \
sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \
signal.o sys.o kmod.o workqueue.o pid.o \
rcupdate.o extable.o params.o posix-timers.o \
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \

View File

@ -7444,17 +7444,16 @@ static struct ctl_table sd_ctl_dir[] = {
.procname = "sched_domain",
.mode = 0555,
},
{0, },
{}
};
static struct ctl_table sd_ctl_root[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = sd_ctl_dir,
},
{0, },
{}
};
static struct ctl_table *sd_alloc_ctl_entry(int n)

View File

@ -49,7 +49,6 @@ static const int slow_work_max_vslow = 99;
ctl_table slow_work_sysctls[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "min-threads",
.data = &slow_work_min_threads,
.maxlen = sizeof(unsigned),
@ -59,7 +58,6 @@ ctl_table slow_work_sysctls[] = {
.extra2 = &slow_work_max_threads,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "max-threads",
.data = &slow_work_max_threads,
.maxlen = sizeof(unsigned),
@ -69,16 +67,15 @@ ctl_table slow_work_sysctls[] = {
.extra2 = (void *) &slow_work_max_max_threads,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "vslow-percentage",
.data = &vslow_work_proportion,
.maxlen = sizeof(unsigned),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.proc_handler = proc_dointvec_minmax,
.extra1 = (void *) &slow_work_min_vslow,
.extra2 = (void *) &slow_work_max_vslow,
},
{ .ctl_name = 0 }
{}
};
#endif

View File

@ -139,7 +139,6 @@ cond_syscall(sys_pciconfig_read);
cond_syscall(sys_pciconfig_write);
cond_syscall(sys_pciconfig_iobase);
cond_syscall(sys32_ipc);
cond_syscall(sys32_sysctl);
cond_syscall(ppc_rtas);
cond_syscall(sys_spu_run);
cond_syscall(sys_spu_create);

File diff suppressed because it is too large Load Diff

1507
kernel/sysctl_binary.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write,
#define proc_do_uts_string NULL
#endif
#ifdef CONFIG_SYSCTL_SYSCALL
/* The generic string strategy routine: */
static int sysctl_uts_string(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
struct ctl_table uts_table;
int r, write;
write = newval && newlen;
memcpy(&uts_table, table, sizeof(uts_table));
uts_table.data = get_uts(table, write);
r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen);
put_uts(table, write, uts_table.data);
return r;
}
#else
#define sysctl_uts_string NULL
#endif
static struct ctl_table uts_kern_table[] = {
{
.ctl_name = KERN_OSTYPE,
.procname = "ostype",
.data = init_uts_ns.name.sysname,
.maxlen = sizeof(init_uts_ns.name.sysname),
.mode = 0444,
.proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
},
{
.ctl_name = KERN_OSRELEASE,
.procname = "osrelease",
.data = init_uts_ns.name.release,
.maxlen = sizeof(init_uts_ns.name.release),
.mode = 0444,
.proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
},
{
.ctl_name = KERN_VERSION,
.procname = "version",
.data = init_uts_ns.name.version,
.maxlen = sizeof(init_uts_ns.name.version),
.mode = 0444,
.proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
},
{
.ctl_name = KERN_NODENAME,
.procname = "hostname",
.data = init_uts_ns.name.nodename,
.maxlen = sizeof(init_uts_ns.name.nodename),
.mode = 0644,
.proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
},
{
.ctl_name = KERN_DOMAINNAME,
.procname = "domainname",
.data = init_uts_ns.name.domainname,
.maxlen = sizeof(init_uts_ns.name.domainname),
.mode = 0644,
.proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
},
{}
};
static struct ctl_table uts_root_table[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = uts_kern_table,

View File

@ -912,7 +912,7 @@ config LATENCYTOP
config SYSCTL_SYSCALL_CHECK
bool "Sysctl checks"
depends on SYSCTL_SYSCALL
depends on SYSCTL
---help---
sys_sysctl uses binary paths that have been found challenging
to properly maintain and use. This enables checks that help

View File

@ -635,19 +635,18 @@ struct net_device *alloc_trdev(int sizeof_priv)
#ifdef CONFIG_SYSCTL
static struct ctl_table tr_table[] = {
{
.ctl_name = NET_TR_RIF_TIMEOUT,
.procname = "rif_timeout",
.data = &sysctl_tr_rif_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ 0 },
{ },
};
static __initdata struct ctl_path tr_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "token-ring", .ctl_name = NET_TR, },
{ .procname = "net", },
{ .procname = "token-ring", },
{ }
};
#endif

View File

@ -12,25 +12,20 @@
static struct ctl_table atalk_table[] = {
{
.ctl_name = NET_ATALK_AARP_EXPIRY_TIME,
.procname = "aarp-expiry-time",
.data = &sysctl_aarp_expiry_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_ATALK_AARP_TICK_TIME,
.procname = "aarp-tick-time",
.data = &sysctl_aarp_tick_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_ATALK_AARP_RETRANSMIT_LIMIT,
.procname = "aarp-retransmit-limit",
.data = &sysctl_aarp_retransmit_limit,
.maxlen = sizeof(int),
@ -38,20 +33,18 @@ static struct ctl_table atalk_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_ATALK_AARP_RESOLVE_TIME,
.procname = "aarp-resolve-time",
.data = &sysctl_aarp_resolve_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{ 0 },
{ },
};
static struct ctl_path atalk_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "appletalk", .ctl_name = NET_ATALK, },
{ .procname = "net", },
{ .procname = "appletalk", },
{ }
};

View File

@ -34,156 +34,128 @@ static ctl_table *ax25_table;
static int ax25_table_size;
static struct ctl_path ax25_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ax25", .ctl_name = NET_AX25, },
{ .procname = "net", },
{ .procname = "ax25", },
{ }
};
static const ctl_table ax25_param_table[] = {
{
.ctl_name = NET_AX25_IP_DEFAULT_MODE,
.procname = "ip_default_mode",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ipdefmode,
.extra2 = &max_ipdefmode
},
{
.ctl_name = NET_AX25_DEFAULT_MODE,
.procname = "ax25_default_mode",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_axdefmode,
.extra2 = &max_axdefmode
},
{
.ctl_name = NET_AX25_BACKOFF_TYPE,
.procname = "backoff_type",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_backoff,
.extra2 = &max_backoff
},
{
.ctl_name = NET_AX25_CONNECT_MODE,
.procname = "connect_mode",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_conmode,
.extra2 = &max_conmode
},
{
.ctl_name = NET_AX25_STANDARD_WINDOW,
.procname = "standard_window_size",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_window,
.extra2 = &max_window
},
{
.ctl_name = NET_AX25_EXTENDED_WINDOW,
.procname = "extended_window_size",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ewindow,
.extra2 = &max_ewindow
},
{
.ctl_name = NET_AX25_T1_TIMEOUT,
.procname = "t1_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t1,
.extra2 = &max_t1
},
{
.ctl_name = NET_AX25_T2_TIMEOUT,
.procname = "t2_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t2,
.extra2 = &max_t2
},
{
.ctl_name = NET_AX25_T3_TIMEOUT,
.procname = "t3_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t3,
.extra2 = &max_t3
},
{
.ctl_name = NET_AX25_IDLE_TIMEOUT,
.procname = "idle_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_idle,
.extra2 = &max_idle
},
{
.ctl_name = NET_AX25_N2,
.procname = "maximum_retry_count",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_n2,
.extra2 = &max_n2
},
{
.ctl_name = NET_AX25_PACLEN,
.procname = "maximum_packet_length",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_paclen,
.extra2 = &max_paclen
},
{
.ctl_name = NET_AX25_PROTOCOL,
.procname = "protocol",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_proto,
.extra2 = &max_proto
},
#ifdef CONFIG_AX25_DAMA_SLAVE
{
.ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT,
.procname = "dama_slave_timeout",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ds_timeout,
.extra2 = &max_ds_timeout
},
#endif
{ .ctl_name = 0 } /* that's all, folks! */
{ } /* that's all, folks! */
};
void ax25_register_sysctl(void)
@ -212,11 +184,9 @@ void ax25_register_sysctl(void)
return;
}
ax25_table[n].child = ax25_dev->systable = child;
ax25_table[n].ctl_name = n + 1;
ax25_table[n].procname = ax25_dev->dev->name;
ax25_table[n].mode = 0555;
child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */
for (k = 0; k < AX25_MAX_VALUES; k++)
child[k].data = &ax25_dev->values[k];
@ -233,7 +203,7 @@ void ax25_unregister_sysctl(void)
ctl_table *p;
unregister_sysctl_table(ax25_table_header);
for (p = ax25_table; p->ctl_name; p++)
for (p = ax25_table; p->procname; p++)
kfree(p->child);
kfree(ax25_table);
}

View File

@ -1013,12 +1013,12 @@ static ctl_table brnf_table[] = {
.mode = 0644,
.proc_handler = brnf_sysctl_call_tables,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_path brnf_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "bridge", .ctl_name = NET_BRIDGE, },
{ .procname = "net", },
{ .procname = "bridge", },
{ }
};
#endif

View File

@ -2566,21 +2566,18 @@ static struct neigh_sysctl_table {
} neigh_sysctl_template __read_mostly = {
.neigh_vars = {
{
.ctl_name = NET_NEIGH_MCAST_SOLICIT,
.procname = "mcast_solicit",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_NEIGH_UCAST_SOLICIT,
.procname = "ucast_solicit",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_NEIGH_APP_SOLICIT,
.procname = "app_solicit",
.maxlen = sizeof(int),
.mode = 0644,
@ -2593,38 +2590,30 @@ static struct neigh_sysctl_table {
.proc_handler = proc_dointvec_userhz_jiffies,
},
{
.ctl_name = NET_NEIGH_REACHABLE_TIME,
.procname = "base_reachable_time",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_NEIGH_DELAY_PROBE_TIME,
.procname = "delay_first_probe_time",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_NEIGH_GC_STALE_TIME,
.procname = "gc_stale_time",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_NEIGH_UNRES_QLEN,
.procname = "unres_qlen",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_NEIGH_PROXY_QLEN,
.procname = "proxy_qlen",
.maxlen = sizeof(int),
.mode = 0644,
@ -2649,45 +2638,36 @@ static struct neigh_sysctl_table {
.proc_handler = proc_dointvec_userhz_jiffies,
},
{
.ctl_name = NET_NEIGH_RETRANS_TIME_MS,
.procname = "retrans_time_ms",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies,
},
{
.ctl_name = NET_NEIGH_REACHABLE_TIME_MS,
.procname = "base_reachable_time_ms",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies,
},
{
.ctl_name = NET_NEIGH_GC_INTERVAL,
.procname = "gc_interval",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_NEIGH_GC_THRESH1,
.procname = "gc_thresh1",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_NEIGH_GC_THRESH2,
.procname = "gc_thresh2",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_NEIGH_GC_THRESH3,
.procname = "gc_thresh3",
.maxlen = sizeof(int),
.mode = 0644,
@ -2699,7 +2679,7 @@ static struct neigh_sysctl_table {
int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
int p_id, int pdev_id, char *p_name,
proc_handler *handler, ctl_handler *strategy)
proc_handler *handler)
{
struct neigh_sysctl_table *t;
const char *dev_name_source = NULL;
@ -2710,10 +2690,10 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
#define NEIGH_CTL_PATH_DEV 3
struct ctl_path neigh_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "proto", .ctl_name = 0, },
{ .procname = "neigh", .ctl_name = 0, },
{ .procname = "default", .ctl_name = NET_PROTO_CONF_DEFAULT, },
{ .procname = "net", },
{ .procname = "proto", },
{ .procname = "neigh", },
{ .procname = "default", },
{ },
};
@ -2738,7 +2718,6 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
if (dev) {
dev_name_source = dev->name;
neigh_path[NEIGH_CTL_PATH_DEV].ctl_name = dev->ifindex;
/* Terminate the table early */
memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14]));
} else {
@ -2750,31 +2729,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
}
if (handler || strategy) {
if (handler) {
/* RetransTime */
t->neigh_vars[3].proc_handler = handler;
t->neigh_vars[3].strategy = strategy;
t->neigh_vars[3].extra1 = dev;
if (!strategy)
t->neigh_vars[3].ctl_name = CTL_UNNUMBERED;
/* ReachableTime */
t->neigh_vars[4].proc_handler = handler;
t->neigh_vars[4].strategy = strategy;
t->neigh_vars[4].extra1 = dev;
if (!strategy)
t->neigh_vars[4].ctl_name = CTL_UNNUMBERED;
/* RetransTime (in milliseconds)*/
t->neigh_vars[12].proc_handler = handler;
t->neigh_vars[12].strategy = strategy;
t->neigh_vars[12].extra1 = dev;
if (!strategy)
t->neigh_vars[12].ctl_name = CTL_UNNUMBERED;
/* ReachableTime (in milliseconds) */
t->neigh_vars[13].proc_handler = handler;
t->neigh_vars[13].strategy = strategy;
t->neigh_vars[13].extra1 = dev;
if (!strategy)
t->neigh_vars[13].ctl_name = CTL_UNNUMBERED;
}
t->dev_name = kstrdup(dev_name_source, GFP_KERNEL);
@ -2782,9 +2749,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
goto free;
neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name;
neigh_path[NEIGH_CTL_PATH_NEIGH].ctl_name = pdev_id;
neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name;
neigh_path[NEIGH_CTL_PATH_PROTO].ctl_name = p_id;
t->sysctl_header =
register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars);

View File

@ -19,7 +19,6 @@
static struct ctl_table net_core_table[] = {
#ifdef CONFIG_NET
{
.ctl_name = NET_CORE_WMEM_MAX,
.procname = "wmem_max",
.data = &sysctl_wmem_max,
.maxlen = sizeof(int),
@ -27,7 +26,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_CORE_RMEM_MAX,
.procname = "rmem_max",
.data = &sysctl_rmem_max,
.maxlen = sizeof(int),
@ -35,7 +33,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_CORE_WMEM_DEFAULT,
.procname = "wmem_default",
.data = &sysctl_wmem_default,
.maxlen = sizeof(int),
@ -43,7 +40,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_CORE_RMEM_DEFAULT,
.procname = "rmem_default",
.data = &sysctl_rmem_default,
.maxlen = sizeof(int),
@ -51,7 +47,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_CORE_DEV_WEIGHT,
.procname = "dev_weight",
.data = &weight_p,
.maxlen = sizeof(int),
@ -59,7 +54,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_CORE_MAX_BACKLOG,
.procname = "netdev_max_backlog",
.data = &netdev_max_backlog,
.maxlen = sizeof(int),
@ -67,16 +61,13 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_CORE_MSG_COST,
.procname = "message_cost",
.data = &net_ratelimit_state.interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_CORE_MSG_BURST,
.procname = "message_burst",
.data = &net_ratelimit_state.burst,
.maxlen = sizeof(int),
@ -84,7 +75,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_CORE_OPTMEM_MAX,
.procname = "optmem_max",
.data = &sysctl_optmem_max,
.maxlen = sizeof(int),
@ -93,7 +83,6 @@ static struct ctl_table net_core_table[] = {
},
#endif /* CONFIG_NET */
{
.ctl_name = NET_CORE_BUDGET,
.procname = "netdev_budget",
.data = &netdev_budget,
.maxlen = sizeof(int),
@ -101,31 +90,29 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_CORE_WARNINGS,
.procname = "warnings",
.data = &net_msg_warn,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table netns_core_table[] = {
{
.ctl_name = NET_CORE_SOMAXCONN,
.procname = "somaxconn",
.data = &init_net.core.sysctl_somaxconn,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ .ctl_name = 0 }
{ }
};
__net_initdata struct ctl_path net_core_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "core", .ctl_name = NET_CORE, },
{ .procname = "net", },
{ .procname = "core", },
{ },
};

View File

@ -93,13 +93,13 @@ static struct ctl_table dccp_default_table[] = {
.proc_handler = proc_dointvec_ms_jiffies,
},
{ .ctl_name = 0, }
{ }
};
static struct ctl_path dccp_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "dccp", .ctl_name = NET_DCCP, },
{ .procname = "default", .ctl_name = NET_DCCP_DEFAULT, },
{ .procname = "net", },
{ .procname = "dccp", },
{ .procname = "default", },
{ }
};

View File

@ -89,7 +89,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1,
.t3 = 10,
.name = "ethernet",
.ctl_name = NET_DECNET_CONF_ETHER,
.up = dn_eth_up,
.down = dn_eth_down,
.timer3 = dn_send_brd_hello,
@ -101,7 +100,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1,
.t3 = 10,
.name = "ipgre",
.ctl_name = NET_DECNET_CONF_GRE,
.timer3 = dn_send_brd_hello,
},
#if 0
@ -112,7 +110,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1,
.t3 = 120,
.name = "x25",
.ctl_name = NET_DECNET_CONF_X25,
.timer3 = dn_send_ptp_hello,
},
#endif
@ -124,7 +121,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1,
.t3 = 10,
.name = "ppp",
.ctl_name = NET_DECNET_CONF_PPP,
.timer3 = dn_send_brd_hello,
},
#endif
@ -135,7 +131,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1,
.t3 = 120,
.name = "ddcmp",
.ctl_name = NET_DECNET_CONF_DDCMP,
.timer3 = dn_send_ptp_hello,
},
{
@ -145,7 +140,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1,
.t3 = 10,
.name = "loopback",
.ctl_name = NET_DECNET_CONF_LOOPBACK,
.timer3 = dn_send_brd_hello,
}
};
@ -166,10 +160,6 @@ static int max_priority[] = { 127 }; /* From DECnet spec */
static int dn_forwarding_proc(ctl_table *, int,
void __user *, size_t *, loff_t *);
static int dn_forwarding_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen);
static struct dn_dev_sysctl_table {
struct ctl_table_header *sysctl_header;
ctl_table dn_dev_vars[5];
@ -177,44 +167,36 @@ static struct dn_dev_sysctl_table {
NULL,
{
{
.ctl_name = NET_DECNET_CONF_DEV_FORWARDING,
.procname = "forwarding",
.data = (void *)DN_DEV_PARMS_OFFSET(forwarding),
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = dn_forwarding_proc,
.strategy = dn_forwarding_sysctl,
},
{
.ctl_name = NET_DECNET_CONF_DEV_PRIORITY,
.procname = "priority",
.data = (void *)DN_DEV_PARMS_OFFSET(priority),
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_priority,
.extra2 = &max_priority
},
{
.ctl_name = NET_DECNET_CONF_DEV_T2,
.procname = "t2",
.data = (void *)DN_DEV_PARMS_OFFSET(t2),
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t2,
.extra2 = &max_t2
},
{
.ctl_name = NET_DECNET_CONF_DEV_T3,
.procname = "t3",
.data = (void *)DN_DEV_PARMS_OFFSET(t3),
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t3,
.extra2 = &max_t3
},
@ -230,9 +212,9 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
#define DN_CTL_PATH_DEV 3
struct ctl_path dn_ctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "decnet", .ctl_name = NET_DECNET, },
{ .procname = "conf", .ctl_name = NET_DECNET_CONF, },
{ .procname = "net", },
{ .procname = "decnet", },
{ .procname = "conf", },
{ /* to be set */ },
{ },
};
@ -248,10 +230,8 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
if (dev) {
dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name;
dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = dev->ifindex;
} else {
dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name;
dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = parms->ctl_name;
}
t->dn_dev_vars[0].extra1 = (void *)dev;
@ -317,44 +297,6 @@ static int dn_forwarding_proc(ctl_table *table, int write,
#endif
}
static int dn_forwarding_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
#ifdef CONFIG_DECNET_ROUTER
struct net_device *dev = table->extra1;
struct dn_dev *dn_db;
int value;
if (table->extra1 == NULL)
return -EINVAL;
dn_db = dev->dn_ptr;
if (newval && newlen) {
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(value, (int __user *)newval))
return -EFAULT;
if (value < 0)
return -EINVAL;
if (value > 2)
return -EINVAL;
if (dn_db->parms.down)
dn_db->parms.down(dev);
dn_db->parms.forwarding = value;
if (dn_db->parms.up)
dn_db->parms.up(dev);
}
return 0;
#else
return -EINVAL;
#endif
}
#else /* CONFIG_SYSCTL */
static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms)
{

View File

@ -131,39 +131,6 @@ static int parse_addr(__le16 *addr, char *str)
return 0;
}
static int dn_node_address_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
size_t len;
__le16 addr;
if (oldval && oldlenp) {
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len != sizeof(unsigned short))
return -EINVAL;
if (put_user(decnet_address, (__le16 __user *)oldval))
return -EFAULT;
}
}
if (newval && newlen) {
if (newlen != sizeof(unsigned short))
return -EINVAL;
if (get_user(addr, (__le16 __user *)newval))
return -EFAULT;
dn_dev_devices_off();
decnet_address = addr;
dn_dev_devices_on();
}
return 0;
}
static int dn_node_address_handler(ctl_table *table, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos)
@ -215,64 +182,6 @@ static int dn_node_address_handler(ctl_table *table, int write,
return 0;
}
static int dn_def_dev_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
size_t len;
struct net_device *dev;
char devname[17];
size_t namel;
int rv = 0;
devname[0] = 0;
if (oldval && oldlenp) {
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
dev = dn_dev_get_default();
if (dev) {
strcpy(devname, dev->name);
dev_put(dev);
}
namel = strlen(devname) + 1;
if (len > namel) len = namel;
if (copy_to_user(oldval, devname, len))
return -EFAULT;
if (put_user(len, oldlenp))
return -EFAULT;
}
}
if (newval && newlen) {
if (newlen > 16)
return -E2BIG;
if (copy_from_user(devname, newval, newlen))
return -EFAULT;
devname[newlen] = 0;
dev = dev_get_by_name(&init_net, devname);
if (dev == NULL)
return -ENODEV;
rv = -ENODEV;
if (dev->dn_ptr != NULL)
rv = dn_dev_set_default(dev, 1);
if (rv)
dev_put(dev);
}
return rv;
}
static int dn_def_dev_handler(ctl_table *table, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos)
@ -338,138 +247,112 @@ static int dn_def_dev_handler(ctl_table *table, int write,
static ctl_table dn_table[] = {
{
.ctl_name = NET_DECNET_NODE_ADDRESS,
.procname = "node_address",
.maxlen = 7,
.mode = 0644,
.proc_handler = dn_node_address_handler,
.strategy = dn_node_address_strategy,
},
{
.ctl_name = NET_DECNET_NODE_NAME,
.procname = "node_name",
.data = node_name,
.maxlen = 7,
.mode = 0644,
.proc_handler = proc_dostring,
.strategy = sysctl_string,
},
{
.ctl_name = NET_DECNET_DEFAULT_DEVICE,
.procname = "default_device",
.maxlen = 16,
.mode = 0644,
.proc_handler = dn_def_dev_handler,
.strategy = dn_def_dev_strategy,
},
{
.ctl_name = NET_DECNET_TIME_WAIT,
.procname = "time_wait",
.data = &decnet_time_wait,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_decnet_time_wait,
.extra2 = &max_decnet_time_wait
},
{
.ctl_name = NET_DECNET_DN_COUNT,
.procname = "dn_count",
.data = &decnet_dn_count,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_state_count,
.extra2 = &max_state_count
},
{
.ctl_name = NET_DECNET_DI_COUNT,
.procname = "di_count",
.data = &decnet_di_count,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_state_count,
.extra2 = &max_state_count
},
{
.ctl_name = NET_DECNET_DR_COUNT,
.procname = "dr_count",
.data = &decnet_dr_count,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_state_count,
.extra2 = &max_state_count
},
{
.ctl_name = NET_DECNET_DST_GC_INTERVAL,
.procname = "dst_gc_interval",
.data = &decnet_dst_gc_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_decnet_dst_gc_interval,
.extra2 = &max_decnet_dst_gc_interval
},
{
.ctl_name = NET_DECNET_NO_FC_MAX_CWND,
.procname = "no_fc_max_cwnd",
.data = &decnet_no_fc_max_cwnd,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_decnet_no_fc_max_cwnd,
.extra2 = &max_decnet_no_fc_max_cwnd
},
{
.ctl_name = NET_DECNET_MEM,
.procname = "decnet_mem",
.data = &sysctl_decnet_mem,
.maxlen = sizeof(sysctl_decnet_mem),
.mode = 0644,
.proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
},
{
.ctl_name = NET_DECNET_RMEM,
.procname = "decnet_rmem",
.data = &sysctl_decnet_rmem,
.maxlen = sizeof(sysctl_decnet_rmem),
.mode = 0644,
.proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
},
{
.ctl_name = NET_DECNET_WMEM,
.procname = "decnet_wmem",
.data = &sysctl_decnet_wmem,
.maxlen = sizeof(sysctl_decnet_wmem),
.mode = 0644,
.proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
},
{
.ctl_name = NET_DECNET_DEBUG_LEVEL,
.procname = "debug",
.data = &decnet_debug_level,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
},
{0}
{ }
};
static struct ctl_path dn_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "decnet", .ctl_name = NET_DECNET, },
{ .procname = "net", },
{ .procname = "decnet", },
{ }
};

View File

@ -1240,7 +1240,7 @@ void __init arp_init(void)
arp_proc_init();
#ifdef CONFIG_SYSCTL
neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4,
NET_IPV4_NEIGH, "ipv4", NULL, NULL);
NET_IPV4_NEIGH, "ipv4", NULL);
#endif
register_netdevice_notifier(&arp_netdev_notifier);
}

View File

@ -1293,58 +1293,6 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
return ret;
}
static int devinet_conf_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
struct ipv4_devconf *cnf;
struct net *net;
int *valp = table->data;
int new;
int i;
if (!newval || !newlen)
return 0;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new, (int __user *)newval))
return -EFAULT;
if (new == *valp)
return 0;
if (oldval && oldlenp) {
size_t len;
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len > table->maxlen)
len = table->maxlen;
if (copy_to_user(oldval, valp, len))
return -EFAULT;
if (put_user(len, oldlenp))
return -EFAULT;
}
}
*valp = new;
cnf = table->extra1;
net = table->extra2;
i = (int *)table->data - cnf->data;
set_bit(i, cnf->state);
if (cnf == net->ipv4.devconf_dflt)
devinet_copy_dflt_conf(net, i);
return 1;
}
static int devinet_sysctl_forward(ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos)
@ -1390,47 +1338,28 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
return ret;
}
int ipv4_doint_and_flush_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen);
struct net *net = table->extra2;
if (ret == 1)
rt_cache_flush(net, 0);
return ret;
}
#define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc, sysctl) \
#define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc) \
{ \
.ctl_name = NET_IPV4_CONF_ ## attr, \
.procname = name, \
.data = ipv4_devconf.data + \
NET_IPV4_CONF_ ## attr - 1, \
.maxlen = sizeof(int), \
.mode = mval, \
.proc_handler = proc, \
.strategy = sysctl, \
.extra1 = &ipv4_devconf, \
}
#define DEVINET_SYSCTL_RW_ENTRY(attr, name) \
DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc, \
devinet_conf_sysctl)
DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc)
#define DEVINET_SYSCTL_RO_ENTRY(attr, name) \
DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc, \
devinet_conf_sysctl)
DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc)
#define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc, sysctl) \
DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc, sysctl)
#define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc) \
DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc)
#define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \
DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush, \
ipv4_doint_and_flush_strategy)
DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush)
static struct devinet_sysctl_table {
struct ctl_table_header *sysctl_header;
@ -1439,8 +1368,7 @@ static struct devinet_sysctl_table {
} devinet_sysctl = {
.devinet_vars = {
DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding",
devinet_sysctl_forward,
devinet_conf_sysctl),
devinet_sysctl_forward),
DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"),
DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"),
@ -1471,7 +1399,7 @@ static struct devinet_sysctl_table {
};
static int __devinet_sysctl_register(struct net *net, char *dev_name,
int ctl_name, struct ipv4_devconf *p)
struct ipv4_devconf *p)
{
int i;
struct devinet_sysctl_table *t;
@ -1479,9 +1407,9 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
#define DEVINET_CTL_PATH_DEV 3
struct ctl_path devinet_ctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv4", .ctl_name = NET_IPV4, },
{ .procname = "conf", .ctl_name = NET_IPV4_CONF, },
{ .procname = "net", },
{ .procname = "ipv4", },
{ .procname = "conf", },
{ /* to be set */ },
{ },
};
@ -1506,7 +1434,6 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
goto free;
devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name;
devinet_ctl_path[DEVINET_CTL_PATH_DEV].ctl_name = ctl_name;
t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path,
t->devinet_vars);
@ -1540,9 +1467,9 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
static void devinet_sysctl_register(struct in_device *idev)
{
neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4,
NET_IPV4_NEIGH, "ipv4", NULL, NULL);
NET_IPV4_NEIGH, "ipv4", NULL);
__devinet_sysctl_register(dev_net(idev->dev), idev->dev->name,
idev->dev->ifindex, &idev->cnf);
&idev->cnf);
}
static void devinet_sysctl_unregister(struct in_device *idev)
@ -1553,14 +1480,12 @@ static void devinet_sysctl_unregister(struct in_device *idev)
static struct ctl_table ctl_forward_entry[] = {
{
.ctl_name = NET_IPV4_FORWARD,
.procname = "ip_forward",
.data = &ipv4_devconf.data[
NET_IPV4_CONF_FORWARDING - 1],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = devinet_sysctl_forward,
.strategy = devinet_conf_sysctl,
.extra1 = &ipv4_devconf,
.extra2 = &init_net,
},
@ -1568,8 +1493,8 @@ static struct ctl_table ctl_forward_entry[] = {
};
static __net_initdata struct ctl_path net_ipv4_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv4", .ctl_name = NET_IPV4, },
{ .procname = "net", },
{ .procname = "ipv4", },
{ },
};
#endif
@ -1608,13 +1533,11 @@ static __net_init int devinet_init_net(struct net *net)
}
#ifdef CONFIG_SYSCTL
err = __devinet_sysctl_register(net, "all",
NET_PROTO_CONF_ALL, all);
err = __devinet_sysctl_register(net, "all", all);
if (err < 0)
goto err_reg_all;
err = __devinet_sysctl_register(net, "default",
NET_PROTO_CONF_DEFAULT, dflt);
err = __devinet_sysctl_register(net, "default", dflt);
if (err < 0)
goto err_reg_dflt;

View File

@ -603,7 +603,6 @@ static int zero;
static struct ctl_table ip4_frags_ns_ctl_table[] = {
{
.ctl_name = NET_IPV4_IPFRAG_HIGH_THRESH,
.procname = "ipfrag_high_thresh",
.data = &init_net.ipv4.frags.high_thresh,
.maxlen = sizeof(int),
@ -611,7 +610,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_IPFRAG_LOW_THRESH,
.procname = "ipfrag_low_thresh",
.data = &init_net.ipv4.frags.low_thresh,
.maxlen = sizeof(int),
@ -619,26 +617,22 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_IPFRAG_TIME,
.procname = "ipfrag_time",
.data = &init_net.ipv4.frags.timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{ }
};
static struct ctl_table ip4_frags_ctl_table[] = {
{
.ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL,
.procname = "ipfrag_secret_interval",
.data = &ip4_frags.secret_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.procname = "ipfrag_max_dist",

View File

@ -248,9 +248,9 @@ module_exit(ipv4_netfilter_fini);
#ifdef CONFIG_SYSCTL
struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv4", .ctl_name = NET_IPV4, },
{ .procname = "netfilter", .ctl_name = NET_IPV4_NETFILTER, },
{ .procname = "net", },
{ .procname = "ipv4", },
{ .procname = "netfilter", },
{ }
};
EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path);

View File

@ -516,14 +516,13 @@ static struct ctl_table_header *ipq_sysctl_header;
static ctl_table ipq_table[] = {
{
.ctl_name = NET_IPQ_QMAX,
.procname = NET_IPQ_QMAX_NAME,
.data = &queue_maxlen,
.maxlen = sizeof(queue_maxlen),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ .ctl_name = 0 }
{ }
};
#endif

View File

@ -195,7 +195,6 @@ static int log_invalid_proto_max = 255;
static ctl_table ip_ct_sysctl_table[] = {
{
.ctl_name = NET_IPV4_NF_CONNTRACK_MAX,
.procname = "ip_conntrack_max",
.data = &nf_conntrack_max,
.maxlen = sizeof(int),
@ -203,7 +202,6 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_NF_CONNTRACK_COUNT,
.procname = "ip_conntrack_count",
.data = &init_net.ct.count,
.maxlen = sizeof(int),
@ -211,7 +209,6 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_NF_CONNTRACK_BUCKETS,
.procname = "ip_conntrack_buckets",
.data = &nf_conntrack_htable_size,
.maxlen = sizeof(unsigned int),
@ -219,7 +216,6 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_NF_CONNTRACK_CHECKSUM,
.procname = "ip_conntrack_checksum",
.data = &init_net.ct.sysctl_checksum,
.maxlen = sizeof(int),
@ -227,19 +223,15 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_NF_CONNTRACK_LOG_INVALID,
.procname = "ip_conntrack_log_invalid",
.data = &init_net.ct.sysctl_log_invalid,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &log_invalid_proto_min,
.extra2 = &log_invalid_proto_max,
},
{
.ctl_name = 0
}
{ }
};
#endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */

View File

@ -270,9 +270,7 @@ static struct ctl_table icmp_sysctl_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.ctl_name = 0
}
{ }
};
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
static struct ctl_table icmp_compat_sysctl_table[] = {
@ -283,9 +281,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.ctl_name = 0
}
{ }
};
#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
#endif /* CONFIG_SYSCTL */

View File

@ -3056,23 +3056,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
return -EINVAL;
}
static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
void __user *oldval,
size_t __user *oldlenp,
void __user *newval,
size_t newlen)
{
int delay;
struct net *net;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(delay, (int __user *)newval))
return -EFAULT;
net = (struct net *)table->extra1;
rt_cache_flush(net, delay);
return 0;
}
static void rt_secret_reschedule(int old)
{
struct net *net;
@ -3117,23 +3100,8 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write,
return ret;
}
static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table,
void __user *oldval,
size_t __user *oldlenp,
void __user *newval,
size_t newlen)
{
int old = ip_rt_secret_interval;
int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen);
rt_secret_reschedule(old);
return ret;
}
static ctl_table ipv4_route_table[] = {
{
.ctl_name = NET_IPV4_ROUTE_GC_THRESH,
.procname = "gc_thresh",
.data = &ipv4_dst_ops.gc_thresh,
.maxlen = sizeof(int),
@ -3141,7 +3109,6 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_MAX_SIZE,
.procname = "max_size",
.data = &ip_rt_max_size,
.maxlen = sizeof(int),
@ -3151,43 +3118,34 @@ static ctl_table ipv4_route_table[] = {
{
/* Deprecated. Use gc_min_interval_ms */
.ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL,
.procname = "gc_min_interval",
.data = &ip_rt_gc_min_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
.procname = "gc_min_interval_ms",
.data = &ip_rt_gc_min_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies,
},
{
.ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT,
.procname = "gc_timeout",
.data = &ip_rt_gc_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV4_ROUTE_GC_INTERVAL,
.procname = "gc_interval",
.data = &ip_rt_gc_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV4_ROUTE_REDIRECT_LOAD,
.procname = "redirect_load",
.data = &ip_rt_redirect_load,
.maxlen = sizeof(int),
@ -3195,7 +3153,6 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_REDIRECT_NUMBER,
.procname = "redirect_number",
.data = &ip_rt_redirect_number,
.maxlen = sizeof(int),
@ -3203,7 +3160,6 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_REDIRECT_SILENCE,
.procname = "redirect_silence",
.data = &ip_rt_redirect_silence,
.maxlen = sizeof(int),
@ -3211,7 +3167,6 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_ERROR_COST,
.procname = "error_cost",
.data = &ip_rt_error_cost,
.maxlen = sizeof(int),
@ -3219,7 +3174,6 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_ERROR_BURST,
.procname = "error_burst",
.data = &ip_rt_error_burst,
.maxlen = sizeof(int),
@ -3227,7 +3181,6 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_GC_ELASTICITY,
.procname = "gc_elasticity",
.data = &ip_rt_gc_elasticity,
.maxlen = sizeof(int),
@ -3235,16 +3188,13 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_MTU_EXPIRES,
.procname = "mtu_expires",
.data = &ip_rt_mtu_expires,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV4_ROUTE_MIN_PMTU,
.procname = "min_pmtu",
.data = &ip_rt_min_pmtu,
.maxlen = sizeof(int),
@ -3252,7 +3202,6 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_MIN_ADVMSS,
.procname = "min_adv_mss",
.data = &ip_rt_min_advmss,
.maxlen = sizeof(int),
@ -3260,50 +3209,46 @@ static ctl_table ipv4_route_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_ROUTE_SECRET_INTERVAL,
.procname = "secret_interval",
.data = &ip_rt_secret_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = ipv4_sysctl_rt_secret_interval,
.strategy = ipv4_sysctl_rt_secret_interval_strategy,
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table empty[1];
static struct ctl_table ipv4_skeleton[] =
{
{ .procname = "route", .ctl_name = NET_IPV4_ROUTE,
{ .procname = "route",
.mode = 0555, .child = ipv4_route_table},
{ .procname = "neigh", .ctl_name = NET_IPV4_NEIGH,
{ .procname = "neigh",
.mode = 0555, .child = empty},
{ }
};
static __net_initdata struct ctl_path ipv4_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv4", .ctl_name = NET_IPV4, },
{ .procname = "net", },
{ .procname = "ipv4", },
{ },
};
static struct ctl_table ipv4_route_flush_table[] = {
{
.ctl_name = NET_IPV4_ROUTE_FLUSH,
.procname = "flush",
.maxlen = sizeof(int),
.mode = 0200,
.proc_handler = ipv4_sysctl_rtcache_flush,
.strategy = ipv4_sysctl_rtcache_flush_strategy,
},
{ .ctl_name = 0 },
{ },
};
static __net_initdata struct ctl_path ipv4_route_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv4", .ctl_name = NET_IPV4, },
{ .procname = "route", .ctl_name = NET_IPV4_ROUTE, },
{ .procname = "net", },
{ .procname = "ipv4", },
{ .procname = "route", },
{ },
};

View File

@ -63,34 +63,6 @@ static int ipv4_local_port_range(ctl_table *table, int write,
return ret;
}
/* Validate changes from sysctl interface. */
static int ipv4_sysctl_local_port_range(ctl_table *table,
void __user *oldval,
size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
int ret;
int range[2];
ctl_table tmp = {
.data = &range,
.maxlen = sizeof(range),
.mode = table->mode,
.extra1 = &ip_local_port_range_min,
.extra2 = &ip_local_port_range_max,
};
inet_get_local_port_range(range, range + 1);
ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen);
if (ret == 0 && newval && newlen) {
if (range[1] < range[0])
ret = -EINVAL;
else
set_local_port_range(range);
}
return ret;
}
static int proc_tcp_congestion_control(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
@ -109,25 +81,6 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write,
return ret;
}
static int sysctl_tcp_congestion_control(ctl_table *table,
void __user *oldval,
size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
char val[TCP_CA_NAME_MAX];
ctl_table tbl = {
.data = val,
.maxlen = TCP_CA_NAME_MAX,
};
int ret;
tcp_get_default_congestion_control(val);
ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen);
if (ret == 1 && newval && newlen)
ret = tcp_set_default_congestion_control(val);
return ret;
}
static int proc_tcp_available_congestion_control(ctl_table *ctl,
int write,
void __user *buffer, size_t *lenp,
@ -165,32 +118,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl,
return ret;
}
static int strategy_allowed_congestion_control(ctl_table *table,
void __user *oldval,
size_t __user *oldlenp,
void __user *newval,
size_t newlen)
{
ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX };
int ret;
tbl.data = kmalloc(tbl.maxlen, GFP_USER);
if (!tbl.data)
return -ENOMEM;
tcp_get_available_congestion_control(tbl.data, tbl.maxlen);
ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen);
if (ret == 1 && newval && newlen)
ret = tcp_set_allowed_congestion_control(tbl.data);
kfree(tbl.data);
return ret;
}
static struct ctl_table ipv4_table[] = {
{
.ctl_name = NET_IPV4_TCP_TIMESTAMPS,
.procname = "tcp_timestamps",
.data = &sysctl_tcp_timestamps,
.maxlen = sizeof(int),
@ -198,7 +127,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_WINDOW_SCALING,
.procname = "tcp_window_scaling",
.data = &sysctl_tcp_window_scaling,
.maxlen = sizeof(int),
@ -206,7 +134,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_SACK,
.procname = "tcp_sack",
.data = &sysctl_tcp_sack,
.maxlen = sizeof(int),
@ -214,7 +141,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_RETRANS_COLLAPSE,
.procname = "tcp_retrans_collapse",
.data = &sysctl_tcp_retrans_collapse,
.maxlen = sizeof(int),
@ -222,17 +148,14 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_DEFAULT_TTL,
.procname = "ip_default_ttl",
.data = &sysctl_ip_default_ttl,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = ipv4_doint_and_flush,
.strategy = ipv4_doint_and_flush_strategy,
.extra2 = &init_net,
},
{
.ctl_name = NET_IPV4_NO_PMTU_DISC,
.procname = "ip_no_pmtu_disc",
.data = &ipv4_config.no_pmtu_disc,
.maxlen = sizeof(int),
@ -240,7 +163,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_NONLOCAL_BIND,
.procname = "ip_nonlocal_bind",
.data = &sysctl_ip_nonlocal_bind,
.maxlen = sizeof(int),
@ -248,7 +170,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_SYN_RETRIES,
.procname = "tcp_syn_retries",
.data = &sysctl_tcp_syn_retries,
.maxlen = sizeof(int),
@ -256,7 +177,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_SYNACK_RETRIES,
.procname = "tcp_synack_retries",
.data = &sysctl_tcp_synack_retries,
.maxlen = sizeof(int),
@ -264,7 +184,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_MAX_ORPHANS,
.procname = "tcp_max_orphans",
.data = &sysctl_tcp_max_orphans,
.maxlen = sizeof(int),
@ -272,7 +191,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_MAX_TW_BUCKETS,
.procname = "tcp_max_tw_buckets",
.data = &tcp_death_row.sysctl_max_tw_buckets,
.maxlen = sizeof(int),
@ -280,7 +198,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_DYNADDR,
.procname = "ip_dynaddr",
.data = &sysctl_ip_dynaddr,
.maxlen = sizeof(int),
@ -288,16 +205,13 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_KEEPALIVE_TIME,
.procname = "tcp_keepalive_time",
.data = &sysctl_tcp_keepalive_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.ctl_name = NET_IPV4_TCP_KEEPALIVE_PROBES,
.procname = "tcp_keepalive_probes",
.data = &sysctl_tcp_keepalive_probes,
.maxlen = sizeof(int),
@ -305,26 +219,21 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_KEEPALIVE_INTVL,
.procname = "tcp_keepalive_intvl",
.data = &sysctl_tcp_keepalive_intvl,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.ctl_name = NET_IPV4_TCP_RETRIES1,
.procname = "tcp_retries1",
.data = &sysctl_tcp_retries1,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra2 = &tcp_retr1_max
},
{
.ctl_name = NET_IPV4_TCP_RETRIES2,
.procname = "tcp_retries2",
.data = &sysctl_tcp_retries2,
.maxlen = sizeof(int),
@ -332,17 +241,14 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_FIN_TIMEOUT,
.procname = "tcp_fin_timeout",
.data = &sysctl_tcp_fin_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
#ifdef CONFIG_SYN_COOKIES
{
.ctl_name = NET_TCP_SYNCOOKIES,
.procname = "tcp_syncookies",
.data = &sysctl_tcp_syncookies,
.maxlen = sizeof(int),
@ -351,7 +257,6 @@ static struct ctl_table ipv4_table[] = {
},
#endif
{
.ctl_name = NET_TCP_TW_RECYCLE,
.procname = "tcp_tw_recycle",
.data = &tcp_death_row.sysctl_tw_recycle,
.maxlen = sizeof(int),
@ -359,7 +264,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_ABORT_ON_OVERFLOW,
.procname = "tcp_abort_on_overflow",
.data = &sysctl_tcp_abort_on_overflow,
.maxlen = sizeof(int),
@ -367,7 +271,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_STDURG,
.procname = "tcp_stdurg",
.data = &sysctl_tcp_stdurg,
.maxlen = sizeof(int),
@ -375,7 +278,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_RFC1337,
.procname = "tcp_rfc1337",
.data = &sysctl_tcp_rfc1337,
.maxlen = sizeof(int),
@ -383,7 +285,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_MAX_SYN_BACKLOG,
.procname = "tcp_max_syn_backlog",
.data = &sysctl_max_syn_backlog,
.maxlen = sizeof(int),
@ -391,17 +292,14 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_LOCAL_PORT_RANGE,
.procname = "ip_local_port_range",
.data = &sysctl_local_ports.range,
.maxlen = sizeof(sysctl_local_ports.range),
.mode = 0644,
.proc_handler = ipv4_local_port_range,
.strategy = ipv4_sysctl_local_port_range,
},
#ifdef CONFIG_IP_MULTICAST
{
.ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS,
.procname = "igmp_max_memberships",
.data = &sysctl_igmp_max_memberships,
.maxlen = sizeof(int),
@ -411,7 +309,6 @@ static struct ctl_table ipv4_table[] = {
#endif
{
.ctl_name = NET_IPV4_IGMP_MAX_MSF,
.procname = "igmp_max_msf",
.data = &sysctl_igmp_max_msf,
.maxlen = sizeof(int),
@ -419,7 +316,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_INET_PEER_THRESHOLD,
.procname = "inet_peer_threshold",
.data = &inet_peer_threshold,
.maxlen = sizeof(int),
@ -427,43 +323,34 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_INET_PEER_MINTTL,
.procname = "inet_peer_minttl",
.data = &inet_peer_minttl,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.ctl_name = NET_IPV4_INET_PEER_MAXTTL,
.procname = "inet_peer_maxttl",
.data = &inet_peer_maxttl,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.ctl_name = NET_IPV4_INET_PEER_GC_MINTIME,
.procname = "inet_peer_gc_mintime",
.data = &inet_peer_gc_mintime,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.ctl_name = NET_IPV4_INET_PEER_GC_MAXTIME,
.procname = "inet_peer_gc_maxtime",
.data = &inet_peer_gc_maxtime,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.ctl_name = NET_TCP_ORPHAN_RETRIES,
.procname = "tcp_orphan_retries",
.data = &sysctl_tcp_orphan_retries,
.maxlen = sizeof(int),
@ -471,7 +358,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_FACK,
.procname = "tcp_fack",
.data = &sysctl_tcp_fack,
.maxlen = sizeof(int),
@ -479,7 +365,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_REORDERING,
.procname = "tcp_reordering",
.data = &sysctl_tcp_reordering,
.maxlen = sizeof(int),
@ -487,7 +372,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_ECN,
.procname = "tcp_ecn",
.data = &sysctl_tcp_ecn,
.maxlen = sizeof(int),
@ -495,7 +379,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_DSACK,
.procname = "tcp_dsack",
.data = &sysctl_tcp_dsack,
.maxlen = sizeof(int),
@ -503,7 +386,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_MEM,
.procname = "tcp_mem",
.data = &sysctl_tcp_mem,
.maxlen = sizeof(sysctl_tcp_mem),
@ -511,7 +393,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_WMEM,
.procname = "tcp_wmem",
.data = &sysctl_tcp_wmem,
.maxlen = sizeof(sysctl_tcp_wmem),
@ -519,7 +400,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_RMEM,
.procname = "tcp_rmem",
.data = &sysctl_tcp_rmem,
.maxlen = sizeof(sysctl_tcp_rmem),
@ -527,7 +407,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_APP_WIN,
.procname = "tcp_app_win",
.data = &sysctl_tcp_app_win,
.maxlen = sizeof(int),
@ -535,7 +414,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_ADV_WIN_SCALE,
.procname = "tcp_adv_win_scale",
.data = &sysctl_tcp_adv_win_scale,
.maxlen = sizeof(int),
@ -543,7 +421,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_TW_REUSE,
.procname = "tcp_tw_reuse",
.data = &sysctl_tcp_tw_reuse,
.maxlen = sizeof(int),
@ -551,7 +428,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_FRTO,
.procname = "tcp_frto",
.data = &sysctl_tcp_frto,
.maxlen = sizeof(int),
@ -559,7 +435,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_FRTO_RESPONSE,
.procname = "tcp_frto_response",
.data = &sysctl_tcp_frto_response,
.maxlen = sizeof(int),
@ -567,7 +442,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_LOW_LATENCY,
.procname = "tcp_low_latency",
.data = &sysctl_tcp_low_latency,
.maxlen = sizeof(int),
@ -575,7 +449,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_TCP_NO_METRICS_SAVE,
.procname = "tcp_no_metrics_save",
.data = &sysctl_tcp_nometrics_save,
.maxlen = sizeof(int),
@ -583,7 +456,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_TCP_MODERATE_RCVBUF,
.procname = "tcp_moderate_rcvbuf",
.data = &sysctl_tcp_moderate_rcvbuf,
.maxlen = sizeof(int),
@ -591,7 +463,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_TCP_TSO_WIN_DIVISOR,
.procname = "tcp_tso_win_divisor",
.data = &sysctl_tcp_tso_win_divisor,
.maxlen = sizeof(int),
@ -599,15 +470,12 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_TCP_CONG_CONTROL,
.procname = "tcp_congestion_control",
.mode = 0644,
.maxlen = TCP_CA_NAME_MAX,
.proc_handler = proc_tcp_congestion_control,
.strategy = sysctl_tcp_congestion_control,
},
{
.ctl_name = NET_TCP_ABC,
.procname = "tcp_abc",
.data = &sysctl_tcp_abc,
.maxlen = sizeof(int),
@ -615,7 +483,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_TCP_MTU_PROBING,
.procname = "tcp_mtu_probing",
.data = &sysctl_tcp_mtu_probing,
.maxlen = sizeof(int),
@ -623,7 +490,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_TCP_BASE_MSS,
.procname = "tcp_base_mss",
.data = &sysctl_tcp_base_mss,
.maxlen = sizeof(int),
@ -631,7 +497,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
.procname = "tcp_workaround_signed_windows",
.data = &sysctl_tcp_workaround_signed_windows,
.maxlen = sizeof(int),
@ -640,7 +505,6 @@ static struct ctl_table ipv4_table[] = {
},
#ifdef CONFIG_NET_DMA
{
.ctl_name = NET_TCP_DMA_COPYBREAK,
.procname = "tcp_dma_copybreak",
.data = &sysctl_tcp_dma_copybreak,
.maxlen = sizeof(int),
@ -649,7 +513,6 @@ static struct ctl_table ipv4_table[] = {
},
#endif
{
.ctl_name = NET_TCP_SLOW_START_AFTER_IDLE,
.procname = "tcp_slow_start_after_idle",
.data = &sysctl_tcp_slow_start_after_idle,
.maxlen = sizeof(int),
@ -658,7 +521,6 @@ static struct ctl_table ipv4_table[] = {
},
#ifdef CONFIG_NETLABEL
{
.ctl_name = NET_CIPSOV4_CACHE_ENABLE,
.procname = "cipso_cache_enable",
.data = &cipso_v4_cache_enabled,
.maxlen = sizeof(int),
@ -666,7 +528,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_CIPSOV4_CACHE_BUCKET_SIZE,
.procname = "cipso_cache_bucket_size",
.data = &cipso_v4_cache_bucketsize,
.maxlen = sizeof(int),
@ -674,7 +535,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_CIPSOV4_RBM_OPTFMT,
.procname = "cipso_rbm_optfmt",
.data = &cipso_v4_rbm_optfmt,
.maxlen = sizeof(int),
@ -682,7 +542,6 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_CIPSOV4_RBM_STRICTVALID,
.procname = "cipso_rbm_strictvalid",
.data = &cipso_v4_rbm_strictvalid,
.maxlen = sizeof(int),
@ -697,15 +556,12 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_tcp_available_congestion_control,
},
{
.ctl_name = NET_TCP_ALLOWED_CONG_CONTROL,
.procname = "tcp_allowed_congestion_control",
.maxlen = TCP_CA_BUF_MAX,
.mode = 0644,
.proc_handler = proc_allowed_congestion_control,
.strategy = strategy_allowed_congestion_control,
},
{
.ctl_name = NET_TCP_MAX_SSTHRESH,
.procname = "tcp_max_ssthresh",
.data = &sysctl_tcp_max_ssthresh,
.maxlen = sizeof(int),
@ -713,41 +569,34 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "udp_mem",
.data = &sysctl_udp_mem,
.maxlen = sizeof(sysctl_udp_mem),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &zero
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "udp_rmem_min",
.data = &sysctl_udp_rmem_min,
.maxlen = sizeof(sysctl_udp_rmem_min),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &zero
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "udp_wmem_min",
.data = &sysctl_udp_wmem_min,
.maxlen = sizeof(sysctl_udp_wmem_min),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &zero
},
{ .ctl_name = 0 }
{ }
};
static struct ctl_table ipv4_net_table[] = {
{
.ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_ALL,
.procname = "icmp_echo_ignore_all",
.data = &init_net.ipv4.sysctl_icmp_echo_ignore_all,
.maxlen = sizeof(int),
@ -755,7 +604,6 @@ static struct ctl_table ipv4_net_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS,
.procname = "icmp_echo_ignore_broadcasts",
.data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts,
.maxlen = sizeof(int),
@ -763,7 +611,6 @@ static struct ctl_table ipv4_net_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,
.procname = "icmp_ignore_bogus_error_responses",
.data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses,
.maxlen = sizeof(int),
@ -771,7 +618,6 @@ static struct ctl_table ipv4_net_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
.procname = "icmp_errors_use_inbound_ifaddr",
.data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr,
.maxlen = sizeof(int),
@ -779,16 +625,13 @@ static struct ctl_table ipv4_net_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_ICMP_RATELIMIT,
.procname = "icmp_ratelimit",
.data = &init_net.ipv4.sysctl_icmp_ratelimit,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies
},
{
.ctl_name = NET_IPV4_ICMP_RATEMASK,
.procname = "icmp_ratemask",
.data = &init_net.ipv4.sysctl_icmp_ratemask,
.maxlen = sizeof(int),
@ -796,7 +639,6 @@ static struct ctl_table ipv4_net_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "rt_cache_rebuild_count",
.data = &init_net.ipv4.sysctl_rt_cache_rebuild_count,
.maxlen = sizeof(int),
@ -807,8 +649,8 @@ static struct ctl_table ipv4_net_table[] = {
};
struct ctl_path net_ipv4_ctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv4", .ctl_name = NET_IPV4, },
{ .procname = "net", },
{ .procname = "ipv4", },
{ },
};
EXPORT_SYMBOL_GPL(net_ipv4_ctl_path);

View File

@ -267,7 +267,6 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
#ifdef CONFIG_SYSCTL
static struct ctl_table xfrm4_policy_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "xfrm4_gc_thresh",
.data = &xfrm4_dst_ops.gc_thresh,
.maxlen = sizeof(int),

View File

@ -4000,41 +4000,6 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
return ret;
}
static int addrconf_sysctl_forward_strategy(ctl_table *table,
void __user *oldval,
size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
int *valp = table->data;
int val = *valp;
int new;
if (!newval || !newlen)
return 0;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new, (int __user *)newval))
return -EFAULT;
if (new == *valp)
return 0;
if (oldval && oldlenp) {
size_t len;
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len > table->maxlen)
len = table->maxlen;
if (copy_to_user(oldval, valp, len))
return -EFAULT;
if (put_user(len, oldlenp))
return -EFAULT;
}
}
*valp = new;
return addrconf_fixup_forwarding(table, valp, val);
}
static void dev_disable_change(struct inet6_dev *idev)
{
if (!idev || !idev->dev)
@ -4113,16 +4078,13 @@ static struct addrconf_sysctl_table
.sysctl_header = NULL,
.addrconf_vars = {
{
.ctl_name = NET_IPV6_FORWARDING,
.procname = "forwarding",
.data = &ipv6_devconf.forwarding,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = addrconf_sysctl_forward,
.strategy = addrconf_sysctl_forward_strategy,
},
{
.ctl_name = NET_IPV6_HOP_LIMIT,
.procname = "hop_limit",
.data = &ipv6_devconf.hop_limit,
.maxlen = sizeof(int),
@ -4130,7 +4092,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_MTU,
.procname = "mtu",
.data = &ipv6_devconf.mtu6,
.maxlen = sizeof(int),
@ -4138,7 +4099,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_ACCEPT_RA,
.procname = "accept_ra",
.data = &ipv6_devconf.accept_ra,
.maxlen = sizeof(int),
@ -4146,7 +4106,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_ACCEPT_REDIRECTS,
.procname = "accept_redirects",
.data = &ipv6_devconf.accept_redirects,
.maxlen = sizeof(int),
@ -4154,7 +4113,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_AUTOCONF,
.procname = "autoconf",
.data = &ipv6_devconf.autoconf,
.maxlen = sizeof(int),
@ -4162,7 +4120,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_DAD_TRANSMITS,
.procname = "dad_transmits",
.data = &ipv6_devconf.dad_transmits,
.maxlen = sizeof(int),
@ -4170,7 +4127,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_RTR_SOLICITS,
.procname = "router_solicitations",
.data = &ipv6_devconf.rtr_solicits,
.maxlen = sizeof(int),
@ -4178,25 +4134,20 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_RTR_SOLICIT_INTERVAL,
.procname = "router_solicitation_interval",
.data = &ipv6_devconf.rtr_solicit_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_RTR_SOLICIT_DELAY,
.procname = "router_solicitation_delay",
.data = &ipv6_devconf.rtr_solicit_delay,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_FORCE_MLD_VERSION,
.procname = "force_mld_version",
.data = &ipv6_devconf.force_mld_version,
.maxlen = sizeof(int),
@ -4205,7 +4156,6 @@ static struct addrconf_sysctl_table
},
#ifdef CONFIG_IPV6_PRIVACY
{
.ctl_name = NET_IPV6_USE_TEMPADDR,
.procname = "use_tempaddr",
.data = &ipv6_devconf.use_tempaddr,
.maxlen = sizeof(int),
@ -4213,7 +4163,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_TEMP_VALID_LFT,
.procname = "temp_valid_lft",
.data = &ipv6_devconf.temp_valid_lft,
.maxlen = sizeof(int),
@ -4221,7 +4170,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_TEMP_PREFERED_LFT,
.procname = "temp_prefered_lft",
.data = &ipv6_devconf.temp_prefered_lft,
.maxlen = sizeof(int),
@ -4229,7 +4177,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_REGEN_MAX_RETRY,
.procname = "regen_max_retry",
.data = &ipv6_devconf.regen_max_retry,
.maxlen = sizeof(int),
@ -4237,7 +4184,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_MAX_DESYNC_FACTOR,
.procname = "max_desync_factor",
.data = &ipv6_devconf.max_desync_factor,
.maxlen = sizeof(int),
@ -4246,7 +4192,6 @@ static struct addrconf_sysctl_table
},
#endif
{
.ctl_name = NET_IPV6_MAX_ADDRESSES,
.procname = "max_addresses",
.data = &ipv6_devconf.max_addresses,
.maxlen = sizeof(int),
@ -4254,7 +4199,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_ACCEPT_RA_DEFRTR,
.procname = "accept_ra_defrtr",
.data = &ipv6_devconf.accept_ra_defrtr,
.maxlen = sizeof(int),
@ -4262,7 +4206,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_ACCEPT_RA_PINFO,
.procname = "accept_ra_pinfo",
.data = &ipv6_devconf.accept_ra_pinfo,
.maxlen = sizeof(int),
@ -4271,7 +4214,6 @@ static struct addrconf_sysctl_table
},
#ifdef CONFIG_IPV6_ROUTER_PREF
{
.ctl_name = NET_IPV6_ACCEPT_RA_RTR_PREF,
.procname = "accept_ra_rtr_pref",
.data = &ipv6_devconf.accept_ra_rtr_pref,
.maxlen = sizeof(int),
@ -4279,17 +4221,14 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_RTR_PROBE_INTERVAL,
.procname = "router_probe_interval",
.data = &ipv6_devconf.rtr_probe_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
#ifdef CONFIG_IPV6_ROUTE_INFO
{
.ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN,
.procname = "accept_ra_rt_info_max_plen",
.data = &ipv6_devconf.accept_ra_rt_info_max_plen,
.maxlen = sizeof(int),
@ -4299,7 +4238,6 @@ static struct addrconf_sysctl_table
#endif
#endif
{
.ctl_name = NET_IPV6_PROXY_NDP,
.procname = "proxy_ndp",
.data = &ipv6_devconf.proxy_ndp,
.maxlen = sizeof(int),
@ -4307,7 +4245,6 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_ACCEPT_SOURCE_ROUTE,
.procname = "accept_source_route",
.data = &ipv6_devconf.accept_source_route,
.maxlen = sizeof(int),
@ -4316,7 +4253,6 @@ static struct addrconf_sysctl_table
},
#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
{
.ctl_name = CTL_UNNUMBERED,
.procname = "optimistic_dad",
.data = &ipv6_devconf.optimistic_dad,
.maxlen = sizeof(int),
@ -4327,7 +4263,6 @@ static struct addrconf_sysctl_table
#endif
#ifdef CONFIG_IPV6_MROUTE
{
.ctl_name = CTL_UNNUMBERED,
.procname = "mc_forwarding",
.data = &ipv6_devconf.mc_forwarding,
.maxlen = sizeof(int),
@ -4336,16 +4271,13 @@ static struct addrconf_sysctl_table
},
#endif
{
.ctl_name = CTL_UNNUMBERED,
.procname = "disable_ipv6",
.data = &ipv6_devconf.disable_ipv6,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = addrconf_sysctl_disable,
.strategy = sysctl_intvec,
},
{
.ctl_name = CTL_UNNUMBERED,
.procname = "accept_dad",
.data = &ipv6_devconf.accept_dad,
.maxlen = sizeof(int),
@ -4353,13 +4285,13 @@ static struct addrconf_sysctl_table
.proc_handler = proc_dointvec,
},
{
.ctl_name = 0, /* sentinel */
/* sentinel */
}
},
};
static int __addrconf_sysctl_register(struct net *net, char *dev_name,
int ctl_name, struct inet6_dev *idev, struct ipv6_devconf *p)
struct inet6_dev *idev, struct ipv6_devconf *p)
{
int i;
struct addrconf_sysctl_table *t;
@ -4367,9 +4299,9 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name,
#define ADDRCONF_CTL_PATH_DEV 3
struct ctl_path addrconf_ctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv6", .ctl_name = NET_IPV6, },
{ .procname = "conf", .ctl_name = NET_IPV6_CONF, },
{ .procname = "net", },
{ .procname = "ipv6", },
{ .procname = "conf", },
{ /* to be set */ },
{ },
};
@ -4395,7 +4327,6 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name,
goto free;
addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].procname = t->dev_name;
addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].ctl_name = ctl_name;
t->sysctl_header = register_net_sysctl_table(net, addrconf_ctl_path,
t->addrconf_vars);
@ -4431,10 +4362,9 @@ static void addrconf_sysctl_register(struct inet6_dev *idev)
{
neigh_sysctl_register(idev->dev, idev->nd_parms, NET_IPV6,
NET_IPV6_NEIGH, "ipv6",
&ndisc_ifinfo_sysctl_change,
ndisc_ifinfo_sysctl_strategy);
&ndisc_ifinfo_sysctl_change);
__addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name,
idev->dev->ifindex, idev, &idev->cnf);
idev, &idev->cnf);
}
static void addrconf_sysctl_unregister(struct inet6_dev *idev)
@ -4473,13 +4403,11 @@ static int addrconf_init_net(struct net *net)
net->ipv6.devconf_dflt = dflt;
#ifdef CONFIG_SYSCTL
err = __addrconf_sysctl_register(net, "all", NET_PROTO_CONF_ALL,
NULL, all);
err = __addrconf_sysctl_register(net, "all", NULL, all);
if (err < 0)
goto err_reg_all;
err = __addrconf_sysctl_register(net, "default", NET_PROTO_CONF_DEFAULT,
NULL, dflt);
err = __addrconf_sysctl_register(net, "default", NULL, dflt);
if (err < 0)
goto err_reg_dflt;
#endif

View File

@ -942,15 +942,13 @@ EXPORT_SYMBOL(icmpv6_err_convert);
#ifdef CONFIG_SYSCTL
ctl_table ipv6_icmp_table_template[] = {
{
.ctl_name = NET_IPV6_ICMP_RATELIMIT,
.procname = "ratelimit",
.data = &init_net.ipv6.sysctl.icmpv6_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies
},
{ .ctl_name = 0 },
{ },
};
struct ctl_table *ipv6_icmp_sysctl_init(struct net *net)

View File

@ -1768,42 +1768,6 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void __user *bu
return ret;
}
int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
struct net_device *dev = ctl->extra1;
struct inet6_dev *idev;
int ret;
if (ctl->ctl_name == NET_NEIGH_RETRANS_TIME ||
ctl->ctl_name == NET_NEIGH_REACHABLE_TIME)
ndisc_warn_deprecated_sysctl(ctl, "procfs", dev ? dev->name : "default");
switch (ctl->ctl_name) {
case NET_NEIGH_REACHABLE_TIME:
ret = sysctl_jiffies(ctl, oldval, oldlenp, newval, newlen);
break;
case NET_NEIGH_RETRANS_TIME_MS:
case NET_NEIGH_REACHABLE_TIME_MS:
ret = sysctl_ms_jiffies(ctl, oldval, oldlenp, newval, newlen);
break;
default:
ret = 0;
}
if (newval && newlen && ret > 0 &&
dev && (idev = in6_dev_get(dev)) != NULL) {
if (ctl->ctl_name == NET_NEIGH_REACHABLE_TIME ||
ctl->ctl_name == NET_NEIGH_REACHABLE_TIME_MS)
idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time);
idev->tstamp = jiffies;
inet6_ifinfo_notify(RTM_NEWLINK, idev);
in6_dev_put(idev);
}
return ret;
}
#endif
@ -1857,8 +1821,7 @@ int __init ndisc_init(void)
#ifdef CONFIG_SYSCTL
err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6,
NET_IPV6_NEIGH, "ipv6",
&ndisc_ifinfo_sysctl_change,
&ndisc_ifinfo_sysctl_strategy);
&ndisc_ifinfo_sysctl_change);
if (err)
goto out_unregister_pernet;
#endif

View File

@ -36,7 +36,6 @@
#define IPQ_QMAX_DEFAULT 1024
#define IPQ_PROC_FS_NAME "ip6_queue"
#define NET_IPQ_QMAX 2088
#define NET_IPQ_QMAX_NAME "ip6_queue_maxlen"
typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long);
@ -518,14 +517,13 @@ static struct ctl_table_header *ipq_sysctl_header;
static ctl_table ipq_table[] = {
{
.ctl_name = NET_IPQ_QMAX,
.procname = NET_IPQ_QMAX_NAME,
.data = &queue_maxlen,
.maxlen = sizeof(queue_maxlen),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ .ctl_name = 0 }
{ }
};
#endif

View File

@ -277,9 +277,7 @@ static struct ctl_table icmpv6_sysctl_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
},
{
.ctl_name = 0
}
{ }
};
#endif /* CONFIG_SYSCTL */

View File

@ -83,7 +83,6 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = {
.proc_handler = proc_dointvec_jiffies,
},
{
.ctl_name = NET_NF_CONNTRACK_FRAG6_LOW_THRESH,
.procname = "nf_conntrack_frag6_low_thresh",
.data = &nf_init_frags.low_thresh,
.maxlen = sizeof(unsigned int),
@ -91,14 +90,13 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_NF_CONNTRACK_FRAG6_HIGH_THRESH,
.procname = "nf_conntrack_frag6_high_thresh",
.data = &nf_init_frags.high_thresh,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{ .ctl_name = 0 }
{ }
};
#endif

View File

@ -636,7 +636,6 @@ static const struct inet6_protocol frag_protocol =
#ifdef CONFIG_SYSCTL
static struct ctl_table ip6_frags_ns_ctl_table[] = {
{
.ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH,
.procname = "ip6frag_high_thresh",
.data = &init_net.ipv6.frags.high_thresh,
.maxlen = sizeof(int),
@ -644,7 +643,6 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH,
.procname = "ip6frag_low_thresh",
.data = &init_net.ipv6.frags.low_thresh,
.maxlen = sizeof(int),
@ -652,26 +650,22 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = {
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV6_IP6FRAG_TIME,
.procname = "ip6frag_time",
.data = &init_net.ipv6.frags.timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{ }
};
static struct ctl_table ip6_frags_ctl_table[] = {
{
.ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL,
.procname = "ip6frag_secret_interval",
.data = &ip6_frags.secret_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{ }
};

View File

@ -2546,7 +2546,6 @@ ctl_table ipv6_route_table_template[] = {
.proc_handler = ipv6_sysctl_rtcache_flush
},
{
.ctl_name = NET_IPV6_ROUTE_GC_THRESH,
.procname = "gc_thresh",
.data = &ip6_dst_ops_template.gc_thresh,
.maxlen = sizeof(int),
@ -2554,7 +2553,6 @@ ctl_table ipv6_route_table_template[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_ROUTE_MAX_SIZE,
.procname = "max_size",
.data = &init_net.ipv6.sysctl.ip6_rt_max_size,
.maxlen = sizeof(int),
@ -2562,69 +2560,55 @@ ctl_table ipv6_route_table_template[] = {
.proc_handler = proc_dointvec,
},
{
.ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL,
.procname = "gc_min_interval",
.data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_ROUTE_GC_TIMEOUT,
.procname = "gc_timeout",
.data = &init_net.ipv6.sysctl.ip6_rt_gc_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_ROUTE_GC_INTERVAL,
.procname = "gc_interval",
.data = &init_net.ipv6.sysctl.ip6_rt_gc_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_ROUTE_GC_ELASTICITY,
.procname = "gc_elasticity",
.data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_ROUTE_MTU_EXPIRES,
.procname = "mtu_expires",
.data = &init_net.ipv6.sysctl.ip6_rt_mtu_expires,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_ROUTE_MIN_ADVMSS,
.procname = "min_adv_mss",
.data = &init_net.ipv6.sysctl.ip6_rt_min_advmss,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
.procname = "gc_min_interval_ms",
.data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies,
},
{ .ctl_name = 0 }
{ }
};
struct ctl_table *ipv6_route_sysctl_init(struct net *net)

View File

@ -16,45 +16,41 @@
static ctl_table ipv6_table_template[] = {
{
.ctl_name = NET_IPV6_ROUTE,
.procname = "route",
.maxlen = 0,
.mode = 0555,
.child = ipv6_route_table_template
},
{
.ctl_name = NET_IPV6_ICMP,
.procname = "icmp",
.maxlen = 0,
.mode = 0555,
.child = ipv6_icmp_table_template
},
{
.ctl_name = NET_IPV6_BINDV6ONLY,
.procname = "bindv6only",
.data = &init_net.ipv6.sysctl.bindv6only,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ .ctl_name = 0 }
{ }
};
static ctl_table ipv6_rotable[] = {
{
.ctl_name = NET_IPV6_MLD_MAX_MSF,
.procname = "mld_max_msf",
.data = &sysctl_mld_max_msf,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{ .ctl_name = 0 }
{ }
};
struct ctl_path net_ipv6_ctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipv6", .ctl_name = NET_IPV6, },
{ .procname = "net", },
{ .procname = "ipv6", },
{ },
};
EXPORT_SYMBOL_GPL(net_ipv6_ctl_path);

View File

@ -309,7 +309,6 @@ static void xfrm6_policy_fini(void)
#ifdef CONFIG_SYSCTL
static struct ctl_table xfrm6_policy_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "xfrm6_gc_thresh",
.data = &xfrm6_dst_ops.gc_thresh,
.maxlen = sizeof(int),

View File

@ -18,19 +18,18 @@ extern int sysctl_ipx_pprop_broadcasting;
static struct ctl_table ipx_table[] = {
{
.ctl_name = NET_IPX_PPROP_BROADCASTING,
.procname = "ipx_pprop_broadcasting",
.data = &sysctl_ipx_pprop_broadcasting,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{ 0 },
{ },
};
static struct ctl_path ipx_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "ipx", .ctl_name = NET_IPX, },
{ .procname = "net", },
{ .procname = "ipx", },
{ }
};

Some files were not shown because too many files have changed in this diff Show More