diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 10:38:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 10:38:50 -0500 |
commit | 1557d33007f63dd96e5d15f33af389378e5f2e54 (patch) | |
tree | 06d05722b2ba5d2a67532f779fa8a88efe3c88f1 | |
parent | 6ec22f9b037fc0c2e00ddb7023fad279c365324d (diff) | |
parent | c656ae95d1c5c8ed5763356263ace2d03087efec (diff) |
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
...
135 files changed, 2183 insertions, 4748 deletions
diff --git a/Documentation/sysctl/ctl_unnumbered.txt b/Documentation/sysctl/ctl_unnumbered.txt deleted file mode 100644 index 23003a8ea3e7..000000000000 --- a/Documentation/sysctl/ctl_unnumbered.txt +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | |||
2 | Except for a few extremely rare exceptions user space applications do not use | ||
3 | the binary sysctl interface. Instead everyone uses /proc/sys/... with | ||
4 | readable ascii names. | ||
5 | |||
6 | Recently the kernel has started supporting setting the binary sysctl value to | ||
7 | CTL_UNNUMBERED so we no longer need to assign a binary sysctl path to allow | ||
8 | sysctls to show up in /proc/sys. | ||
9 | |||
10 | Assigning binary sysctl numbers is an endless source of conflicts in sysctl.h, | ||
11 | breaking of the user space ABI (because of those conflicts), and maintenance | ||
12 | problems. A complete pass through all of the sysctl users revealed multiple | ||
13 | instances where the sysctl binary interface was broken and had gone undetected | ||
14 | for years. | ||
15 | |||
16 | So please do not add new binary sysctl numbers. They are unneeded and | ||
17 | problematic. | ||
18 | |||
19 | If you really need a new binary sysctl number please first merge your sysctl | ||
20 | into the kernel and then as a separate patch allocate a binary sysctl number. | ||
21 | |||
22 | (ebiederm@xmission.com, June 2007) | ||
diff --git a/arch/arm/kernel/isa.c b/arch/arm/kernel/isa.c index 8ac9b8424007..346485910732 100644 --- a/arch/arm/kernel/isa.c +++ b/arch/arm/kernel/isa.c | |||
@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift; | |||
22 | 22 | ||
23 | static ctl_table ctl_isa_vars[4] = { | 23 | static ctl_table ctl_isa_vars[4] = { |
24 | { | 24 | { |
25 | .ctl_name = BUS_ISA_MEM_BASE, | ||
26 | .procname = "membase", | 25 | .procname = "membase", |
27 | .data = &isa_membase, | 26 | .data = &isa_membase, |
28 | .maxlen = sizeof(isa_membase), | 27 | .maxlen = sizeof(isa_membase), |
29 | .mode = 0444, | 28 | .mode = 0444, |
30 | .proc_handler = &proc_dointvec, | 29 | .proc_handler = proc_dointvec, |
31 | }, { | 30 | }, { |
32 | .ctl_name = BUS_ISA_PORT_BASE, | ||
33 | .procname = "portbase", | 31 | .procname = "portbase", |
34 | .data = &isa_portbase, | 32 | .data = &isa_portbase, |
35 | .maxlen = sizeof(isa_portbase), | 33 | .maxlen = sizeof(isa_portbase), |
36 | .mode = 0444, | 34 | .mode = 0444, |
37 | .proc_handler = &proc_dointvec, | 35 | .proc_handler = proc_dointvec, |
38 | }, { | 36 | }, { |
39 | .ctl_name = BUS_ISA_PORT_SHIFT, | ||
40 | .procname = "portshift", | 37 | .procname = "portshift", |
41 | .data = &isa_portshift, | 38 | .data = &isa_portshift, |
42 | .maxlen = sizeof(isa_portshift), | 39 | .maxlen = sizeof(isa_portshift), |
43 | .mode = 0444, | 40 | .mode = 0444, |
44 | .proc_handler = &proc_dointvec, | 41 | .proc_handler = proc_dointvec, |
45 | }, {0} | 42 | }, {} |
46 | }; | 43 | }; |
47 | 44 | ||
48 | static struct ctl_table_header *isa_sysctl_header; | 45 | static struct ctl_table_header *isa_sysctl_header; |
49 | 46 | ||
50 | static ctl_table ctl_isa[2] = { | 47 | static ctl_table ctl_isa[2] = { |
51 | { | 48 | { |
52 | .ctl_name = CTL_BUS_ISA, | ||
53 | .procname = "isa", | 49 | .procname = "isa", |
54 | .mode = 0555, | 50 | .mode = 0555, |
55 | .child = ctl_isa_vars, | 51 | .child = ctl_isa_vars, |
56 | }, {0} | 52 | }, {} |
57 | }; | 53 | }; |
58 | 54 | ||
59 | static ctl_table ctl_bus[2] = { | 55 | static ctl_table ctl_bus[2] = { |
60 | { | 56 | { |
61 | .ctl_name = CTL_BUS, | ||
62 | .procname = "bus", | 57 | .procname = "bus", |
63 | .mode = 0555, | 58 | .mode = 0555, |
64 | .child = ctl_isa, | 59 | .child = ctl_isa, |
65 | }, {0} | 60 | }, {} |
66 | }; | 61 | }; |
67 | 62 | ||
68 | void __init | 63 | void __init |
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c index 0da693b0f7e1..fbe6fa02c882 100644 --- a/arch/arm/mach-bcmring/arch.c +++ b/arch/arm/mach-bcmring/arch.c | |||
@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio) | |||
47 | EXPORT_SYMBOL(bcmring_gpio_reg_lock); | 47 | EXPORT_SYMBOL(bcmring_gpio_reg_lock); |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | /* FIXME: temporary solution */ | ||
51 | #define BCM_SYSCTL_REBOOT_WARM 1 | ||
52 | #define CTL_BCM_REBOOT 112 | ||
53 | |||
54 | /* sysctl */ | 50 | /* sysctl */ |
55 | int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */ | 51 | int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */ |
56 | 52 | ||
@@ -58,18 +54,16 @@ static struct ctl_table_header *bcmring_sysctl_header; | |||
58 | 54 | ||
59 | static struct ctl_table bcmring_sysctl_warm_reboot[] = { | 55 | static struct ctl_table bcmring_sysctl_warm_reboot[] = { |
60 | { | 56 | { |
61 | .ctl_name = BCM_SYSCTL_REBOOT_WARM, | ||
62 | .procname = "warm", | 57 | .procname = "warm", |
63 | .data = &bcmring_arch_warm_reboot, | 58 | .data = &bcmring_arch_warm_reboot, |
64 | .maxlen = sizeof(int), | 59 | .maxlen = sizeof(int), |
65 | .mode = 0644, | 60 | .mode = 0644, |
66 | .proc_handler = &proc_dointvec}, | 61 | .proc_handler = proc_dointvec}, |
67 | {} | 62 | {} |
68 | }; | 63 | }; |
69 | 64 | ||
70 | static struct ctl_table bcmring_sysctl_reboot[] = { | 65 | static struct ctl_table bcmring_sysctl_reboot[] = { |
71 | { | 66 | { |
72 | .ctl_name = CTL_BCM_REBOOT, | ||
73 | .procname = "reboot", | 67 | .procname = "reboot", |
74 | .mode = 0555, | 68 | .mode = 0555, |
75 | .child = bcmring_sysctl_warm_reboot}, | 69 | .child = bcmring_sysctl_warm_reboot}, |
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c index 0d4d3e3a4cfc..5fa3889d858b 100644 --- a/arch/frv/kernel/pm.c +++ b/arch/frv/kernel/pm.c | |||
@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write, | |||
211 | return try_set_cmode(new_cmode)?:*lenp; | 211 | return try_set_cmode(new_cmode)?:*lenp; |
212 | } | 212 | } |
213 | 213 | ||
214 | static int cmode_sysctl(ctl_table *table, | ||
215 | void __user *oldval, size_t __user *oldlenp, | ||
216 | void __user *newval, size_t newlen) | ||
217 | { | ||
218 | if (oldval && oldlenp) { | ||
219 | size_t oldlen; | ||
220 | |||
221 | if (get_user(oldlen, oldlenp)) | ||
222 | return -EFAULT; | ||
223 | |||
224 | if (oldlen != sizeof(int)) | ||
225 | return -EINVAL; | ||
226 | |||
227 | if (put_user(clock_cmode_current, (unsigned __user *)oldval) || | ||
228 | put_user(sizeof(int), oldlenp)) | ||
229 | return -EFAULT; | ||
230 | } | ||
231 | if (newval && newlen) { | ||
232 | int new_cmode; | ||
233 | |||
234 | if (newlen != sizeof(int)) | ||
235 | return -EINVAL; | ||
236 | |||
237 | if (get_user(new_cmode, (int __user *)newval)) | ||
238 | return -EFAULT; | ||
239 | |||
240 | return try_set_cmode(new_cmode)?:1; | ||
241 | } | ||
242 | return 1; | ||
243 | } | ||
244 | |||
245 | static int try_set_p0(int new_p0) | 214 | static int try_set_p0(int new_p0) |
246 | { | 215 | { |
247 | unsigned long flags, clkc; | 216 | unsigned long flags, clkc; |
@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write, | |||
314 | return try_set_p0(new_p0)?:*lenp; | 283 | return try_set_p0(new_p0)?:*lenp; |
315 | } | 284 | } |
316 | 285 | ||
317 | static int p0_sysctl(ctl_table *table, | ||
318 | void __user *oldval, size_t __user *oldlenp, | ||
319 | void __user *newval, size_t newlen) | ||
320 | { | ||
321 | if (oldval && oldlenp) { | ||
322 | size_t oldlen; | ||
323 | |||
324 | if (get_user(oldlen, oldlenp)) | ||
325 | return -EFAULT; | ||
326 | |||
327 | if (oldlen != sizeof(int)) | ||
328 | return -EINVAL; | ||
329 | |||
330 | if (put_user(clock_p0_current, (unsigned __user *)oldval) || | ||
331 | put_user(sizeof(int), oldlenp)) | ||
332 | return -EFAULT; | ||
333 | } | ||
334 | if (newval && newlen) { | ||
335 | int new_p0; | ||
336 | |||
337 | if (newlen != sizeof(int)) | ||
338 | return -EINVAL; | ||
339 | |||
340 | if (get_user(new_p0, (int __user *)newval)) | ||
341 | return -EFAULT; | ||
342 | |||
343 | return try_set_p0(new_p0)?:1; | ||
344 | } | ||
345 | return 1; | ||
346 | } | ||
347 | |||
348 | static int cm_procctl(ctl_table *ctl, int write, | 286 | static int cm_procctl(ctl_table *ctl, int write, |
349 | void __user *buffer, size_t *lenp, loff_t *fpos) | 287 | void __user *buffer, size_t *lenp, loff_t *fpos) |
350 | { | 288 | { |
@@ -358,87 +296,47 @@ static int cm_procctl(ctl_table *ctl, int write, | |||
358 | return try_set_cm(new_cm)?:*lenp; | 296 | return try_set_cm(new_cm)?:*lenp; |
359 | } | 297 | } |
360 | 298 | ||
361 | static int cm_sysctl(ctl_table *table, | ||
362 | void __user *oldval, size_t __user *oldlenp, | ||
363 | void __user *newval, size_t newlen) | ||
364 | { | ||
365 | if (oldval && oldlenp) { | ||
366 | size_t oldlen; | ||
367 | |||
368 | if (get_user(oldlen, oldlenp)) | ||
369 | return -EFAULT; | ||
370 | |||
371 | if (oldlen != sizeof(int)) | ||
372 | return -EINVAL; | ||
373 | |||
374 | if (put_user(clock_cm_current, (unsigned __user *)oldval) || | ||
375 | put_user(sizeof(int), oldlenp)) | ||
376 | return -EFAULT; | ||
377 | } | ||
378 | if (newval && newlen) { | ||
379 | int new_cm; | ||
380 | |||
381 | if (newlen != sizeof(int)) | ||
382 | return -EINVAL; | ||
383 | |||
384 | if (get_user(new_cm, (int __user *)newval)) | ||
385 | return -EFAULT; | ||
386 | |||
387 | return try_set_cm(new_cm)?:1; | ||
388 | } | ||
389 | return 1; | ||
390 | } | ||
391 | |||
392 | |||
393 | static struct ctl_table pm_table[] = | 299 | static struct ctl_table pm_table[] = |
394 | { | 300 | { |
395 | { | 301 | { |
396 | .ctl_name = CTL_PM_SUSPEND, | ||
397 | .procname = "suspend", | 302 | .procname = "suspend", |
398 | .data = NULL, | 303 | .data = NULL, |
399 | .maxlen = 0, | 304 | .maxlen = 0, |
400 | .mode = 0200, | 305 | .mode = 0200, |
401 | .proc_handler = &sysctl_pm_do_suspend, | 306 | .proc_handler = sysctl_pm_do_suspend, |
402 | }, | 307 | }, |
403 | { | 308 | { |
404 | .ctl_name = CTL_PM_CMODE, | ||
405 | .procname = "cmode", | 309 | .procname = "cmode", |
406 | .data = &clock_cmode_current, | 310 | .data = &clock_cmode_current, |
407 | .maxlen = sizeof(int), | 311 | .maxlen = sizeof(int), |
408 | .mode = 0644, | 312 | .mode = 0644, |
409 | .proc_handler = &cmode_procctl, | 313 | .proc_handler = cmode_procctl, |
410 | .strategy = &cmode_sysctl, | ||
411 | }, | 314 | }, |
412 | { | 315 | { |
413 | .ctl_name = CTL_PM_P0, | ||
414 | .procname = "p0", | 316 | .procname = "p0", |
415 | .data = &clock_p0_current, | 317 | .data = &clock_p0_current, |
416 | .maxlen = sizeof(int), | 318 | .maxlen = sizeof(int), |
417 | .mode = 0644, | 319 | .mode = 0644, |
418 | .proc_handler = &p0_procctl, | 320 | .proc_handler = p0_procctl, |
419 | .strategy = &p0_sysctl, | ||
420 | }, | 321 | }, |
421 | { | 322 | { |
422 | .ctl_name = CTL_PM_CM, | ||
423 | .procname = "cm", | 323 | .procname = "cm", |
424 | .data = &clock_cm_current, | 324 | .data = &clock_cm_current, |
425 | .maxlen = sizeof(int), | 325 | .maxlen = sizeof(int), |
426 | .mode = 0644, | 326 | .mode = 0644, |
427 | .proc_handler = &cm_procctl, | 327 | .proc_handler = cm_procctl, |
428 | .strategy = &cm_sysctl, | ||
429 | }, | 328 | }, |
430 | { .ctl_name = 0} | 329 | { } |
431 | }; | 330 | }; |
432 | 331 | ||
433 | static struct ctl_table pm_dir_table[] = | 332 | static struct ctl_table pm_dir_table[] = |
434 | { | 333 | { |
435 | { | 334 | { |
436 | .ctl_name = CTL_PM, | ||
437 | .procname = "pm", | 335 | .procname = "pm", |
438 | .mode = 0555, | 336 | .mode = 0555, |
439 | .child = pm_table, | 337 | .child = pm_table, |
440 | }, | 338 | }, |
441 | { .ctl_name = 0} | 339 | { } |
442 | }; | 340 | }; |
443 | 341 | ||
444 | /* | 342 | /* |
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c index 3e9d7e03fb95..035516cb7a97 100644 --- a/arch/frv/kernel/sysctl.c +++ b/arch/frv/kernel/sysctl.c | |||
@@ -176,21 +176,19 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp, | |||
176 | static struct ctl_table frv_table[] = | 176 | static struct ctl_table frv_table[] = |
177 | { | 177 | { |
178 | { | 178 | { |
179 | .ctl_name = 1, | ||
180 | .procname = "cache-mode", | 179 | .procname = "cache-mode", |
181 | .data = NULL, | 180 | .data = NULL, |
182 | .maxlen = 0, | 181 | .maxlen = 0, |
183 | .mode = 0644, | 182 | .mode = 0644, |
184 | .proc_handler = &procctl_frv_cachemode, | 183 | .proc_handler = procctl_frv_cachemode, |
185 | }, | 184 | }, |
186 | #ifdef CONFIG_MMU | 185 | #ifdef CONFIG_MMU |
187 | { | 186 | { |
188 | .ctl_name = 2, | ||
189 | .procname = "pin-cxnr", | 187 | .procname = "pin-cxnr", |
190 | .data = NULL, | 188 | .data = NULL, |
191 | .maxlen = 0, | 189 | .maxlen = 0, |
192 | .mode = 0644, | 190 | .mode = 0644, |
193 | .proc_handler = &procctl_frv_pin_cxnr | 191 | .proc_handler = procctl_frv_pin_cxnr |
194 | }, | 192 | }, |
195 | #endif | 193 | #endif |
196 | {} | 194 | {} |
@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] = | |||
203 | static struct ctl_table frv_dir_table[] = | 201 | static struct ctl_table frv_dir_table[] = |
204 | { | 202 | { |
205 | { | 203 | { |
206 | .ctl_name = CTL_FRV, | ||
207 | .procname = "frv", | 204 | .procname = "frv", |
208 | .mode = 0555, | 205 | .mode = 0555, |
209 | .child = frv_table | 206 | .child = frv_table |
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S index af9405cd70e5..10c37510f4b4 100644 --- a/arch/ia64/ia32/ia32_entry.S +++ b/arch/ia64/ia32/ia32_entry.S | |||
@@ -327,7 +327,7 @@ ia32_syscall_table: | |||
327 | data8 compat_sys_writev | 327 | data8 compat_sys_writev |
328 | data8 sys_getsid | 328 | data8 sys_getsid |
329 | data8 sys_fdatasync | 329 | data8 sys_fdatasync |
330 | data8 sys32_sysctl | 330 | data8 compat_sys_sysctl |
331 | data8 sys_mlock /* 150 */ | 331 | data8 sys_mlock /* 150 */ |
332 | data8 sys_munlock | 332 | data8 sys_munlock |
333 | data8 sys_mlockall | 333 | data8 sys_mlockall |
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index 625ed8f76fce..429ec968c9ee 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c | |||
@@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags) | |||
1628 | return sys_msync(addr, len + (start - addr), flags); | 1628 | return sys_msync(addr, len + (start - addr), flags); |
1629 | } | 1629 | } |
1630 | 1630 | ||
1631 | struct sysctl32 { | ||
1632 | unsigned int name; | ||
1633 | int nlen; | ||
1634 | unsigned int oldval; | ||
1635 | unsigned int oldlenp; | ||
1636 | unsigned int newval; | ||
1637 | unsigned int newlen; | ||
1638 | unsigned int __unused[4]; | ||
1639 | }; | ||
1640 | |||
1641 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
1642 | asmlinkage long | ||
1643 | sys32_sysctl (struct sysctl32 __user *args) | ||
1644 | { | ||
1645 | struct sysctl32 a32; | ||
1646 | mm_segment_t old_fs = get_fs (); | ||
1647 | void __user *oldvalp, *newvalp; | ||
1648 | size_t oldlen; | ||
1649 | int __user *namep; | ||
1650 | long ret; | ||
1651 | |||
1652 | if (copy_from_user(&a32, args, sizeof(a32))) | ||
1653 | return -EFAULT; | ||
1654 | |||
1655 | /* | ||
1656 | * We need to pre-validate these because we have to disable address checking | ||
1657 | * before calling do_sysctl() because of OLDLEN but we can't run the risk of the | ||
1658 | * user specifying bad addresses here. Well, since we're dealing with 32 bit | ||
1659 | * addresses, we KNOW that access_ok() will always succeed, so this is an | ||
1660 | * expensive NOP, but so what... | ||
1661 | */ | ||
1662 | namep = (int __user *) compat_ptr(a32.name); | ||
1663 | oldvalp = compat_ptr(a32.oldval); | ||
1664 | newvalp = compat_ptr(a32.newval); | ||
1665 | |||
1666 | if ((oldvalp && get_user(oldlen, (int __user *) compat_ptr(a32.oldlenp))) | ||
1667 | || !access_ok(VERIFY_WRITE, namep, 0) | ||
1668 | || !access_ok(VERIFY_WRITE, oldvalp, 0) | ||
1669 | || !access_ok(VERIFY_WRITE, newvalp, 0)) | ||
1670 | return -EFAULT; | ||
1671 | |||
1672 | set_fs(KERNEL_DS); | ||
1673 | lock_kernel(); | ||
1674 | ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen, | ||
1675 | newvalp, (size_t) a32.newlen); | ||
1676 | unlock_kernel(); | ||
1677 | set_fs(old_fs); | ||
1678 | |||
1679 | if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp))) | ||
1680 | return -EFAULT; | ||
1681 | |||
1682 | return ret; | ||
1683 | } | ||
1684 | #endif | ||
1685 | |||
1686 | asmlinkage long | 1631 | asmlinkage long |
1687 | sys32_newuname (struct new_utsname __user *name) | 1632 | sys32_newuname (struct new_utsname __user *name) |
1688 | { | 1633 | { |
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index 6631a9dfafdc..b942f4032d7a 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c | |||
@@ -239,32 +239,29 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) | |||
239 | #ifdef CONFIG_SYSCTL | 239 | #ifdef CONFIG_SYSCTL |
240 | static ctl_table kdump_ctl_table[] = { | 240 | static ctl_table kdump_ctl_table[] = { |
241 | { | 241 | { |
242 | .ctl_name = CTL_UNNUMBERED, | ||
243 | .procname = "kdump_on_init", | 242 | .procname = "kdump_on_init", |
244 | .data = &kdump_on_init, | 243 | .data = &kdump_on_init, |
245 | .maxlen = sizeof(int), | 244 | .maxlen = sizeof(int), |
246 | .mode = 0644, | 245 | .mode = 0644, |
247 | .proc_handler = &proc_dointvec, | 246 | .proc_handler = proc_dointvec, |
248 | }, | 247 | }, |
249 | { | 248 | { |
250 | .ctl_name = CTL_UNNUMBERED, | ||
251 | .procname = "kdump_on_fatal_mca", | 249 | .procname = "kdump_on_fatal_mca", |
252 | .data = &kdump_on_fatal_mca, | 250 | .data = &kdump_on_fatal_mca, |
253 | .maxlen = sizeof(int), | 251 | .maxlen = sizeof(int), |
254 | .mode = 0644, | 252 | .mode = 0644, |
255 | .proc_handler = &proc_dointvec, | 253 | .proc_handler = proc_dointvec, |
256 | }, | 254 | }, |
257 | { .ctl_name = 0 } | 255 | { } |
258 | }; | 256 | }; |
259 | 257 | ||
260 | static ctl_table sys_table[] = { | 258 | static ctl_table sys_table[] = { |
261 | { | 259 | { |
262 | .ctl_name = CTL_KERN, | ||
263 | .procname = "kernel", | 260 | .procname = "kernel", |
264 | .mode = 0555, | 261 | .mode = 0555, |
265 | .child = kdump_ctl_table, | 262 | .child = kdump_ctl_table, |
266 | }, | 263 | }, |
267 | { .ctl_name = 0 } | 264 | { } |
268 | }; | 265 | }; |
269 | #endif | 266 | #endif |
270 | 267 | ||
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index f1782705b1f7..402698b6689f 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -522,42 +522,37 @@ EXPORT_SYMBOL(pfm_sysctl); | |||
522 | 522 | ||
523 | static ctl_table pfm_ctl_table[]={ | 523 | static ctl_table pfm_ctl_table[]={ |
524 | { | 524 | { |
525 | .ctl_name = CTL_UNNUMBERED, | ||
526 | .procname = "debug", | 525 | .procname = "debug", |
527 | .data = &pfm_sysctl.debug, | 526 | .data = &pfm_sysctl.debug, |
528 | .maxlen = sizeof(int), | 527 | .maxlen = sizeof(int), |
529 | .mode = 0666, | 528 | .mode = 0666, |
530 | .proc_handler = &proc_dointvec, | 529 | .proc_handler = proc_dointvec, |
531 | }, | 530 | }, |
532 | { | 531 | { |
533 | .ctl_name = CTL_UNNUMBERED, | ||
534 | .procname = "debug_ovfl", | 532 | .procname = "debug_ovfl", |
535 | .data = &pfm_sysctl.debug_ovfl, | 533 | .data = &pfm_sysctl.debug_ovfl, |
536 | .maxlen = sizeof(int), | 534 | .maxlen = sizeof(int), |
537 | .mode = 0666, | 535 | .mode = 0666, |
538 | .proc_handler = &proc_dointvec, | 536 | .proc_handler = proc_dointvec, |
539 | }, | 537 | }, |
540 | { | 538 | { |
541 | .ctl_name = CTL_UNNUMBERED, | ||
542 | .procname = "fastctxsw", | 539 | .procname = "fastctxsw", |
543 | .data = &pfm_sysctl.fastctxsw, | 540 | .data = &pfm_sysctl.fastctxsw, |
544 | .maxlen = sizeof(int), | 541 | .maxlen = sizeof(int), |
545 | .mode = 0600, | 542 | .mode = 0600, |
546 | .proc_handler = &proc_dointvec, | 543 | .proc_handler = proc_dointvec, |
547 | }, | 544 | }, |
548 | { | 545 | { |
549 | .ctl_name = CTL_UNNUMBERED, | ||
550 | .procname = "expert_mode", | 546 | .procname = "expert_mode", |
551 | .data = &pfm_sysctl.expert_mode, | 547 | .data = &pfm_sysctl.expert_mode, |
552 | .maxlen = sizeof(int), | 548 | .maxlen = sizeof(int), |
553 | .mode = 0600, | 549 | .mode = 0600, |
554 | .proc_handler = &proc_dointvec, | 550 | .proc_handler = proc_dointvec, |
555 | }, | 551 | }, |
556 | {} | 552 | {} |
557 | }; | 553 | }; |
558 | static ctl_table pfm_sysctl_dir[] = { | 554 | static ctl_table pfm_sysctl_dir[] = { |
559 | { | 555 | { |
560 | .ctl_name = CTL_UNNUMBERED, | ||
561 | .procname = "perfmon", | 556 | .procname = "perfmon", |
562 | .mode = 0555, | 557 | .mode = 0555, |
563 | .child = pfm_ctl_table, | 558 | .child = pfm_ctl_table, |
@@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = { | |||
566 | }; | 561 | }; |
567 | static ctl_table pfm_sysctl_root[] = { | 562 | static ctl_table pfm_sysctl_root[] = { |
568 | { | 563 | { |
569 | .ctl_name = CTL_KERN, | ||
570 | .procname = "kernel", | 564 | .procname = "kernel", |
571 | .mode = 0555, | 565 | .mode = 0555, |
572 | .child = pfm_sysctl_dir, | 566 | .child = pfm_sysctl_dir, |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index b77fefaff9da..1a2793efdc4e 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, | |||
265 | } | 265 | } |
266 | #endif | 266 | #endif |
267 | 267 | ||
268 | struct sysctl_args32 | ||
269 | { | ||
270 | compat_caddr_t name; | ||
271 | int nlen; | ||
272 | compat_caddr_t oldval; | ||
273 | compat_caddr_t oldlenp; | ||
274 | compat_caddr_t newval; | ||
275 | compat_size_t newlen; | ||
276 | unsigned int __unused[4]; | ||
277 | }; | ||
278 | |||
279 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
280 | |||
281 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
282 | { | ||
283 | struct sysctl_args32 tmp; | ||
284 | int error; | ||
285 | size_t oldlen; | ||
286 | size_t __user *oldlenp = NULL; | ||
287 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7; | ||
288 | |||
289 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
290 | return -EFAULT; | ||
291 | |||
292 | if (tmp.oldval && tmp.oldlenp) { | ||
293 | /* Duh, this is ugly and might not work if sysctl_args | ||
294 | is in read-only memory, but do_sysctl does indirectly | ||
295 | a lot of uaccess in both directions and we'd have to | ||
296 | basically copy the whole sysctl.c here, and | ||
297 | glibc's __sysctl uses rw memory for the structure | ||
298 | anyway. */ | ||
299 | if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) || | ||
300 | put_user(oldlen, (size_t __user *)addr)) | ||
301 | return -EFAULT; | ||
302 | oldlenp = (size_t __user *)addr; | ||
303 | } | ||
304 | |||
305 | lock_kernel(); | ||
306 | error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval), | ||
307 | oldlenp, (void __user *)A(tmp.newval), tmp.newlen); | ||
308 | unlock_kernel(); | ||
309 | if (oldlenp) { | ||
310 | if (!error) { | ||
311 | if (get_user(oldlen, (size_t __user *)addr) || | ||
312 | put_user(oldlen, (u32 __user *)A(tmp.oldlenp))) | ||
313 | error = -EFAULT; | ||
314 | } | ||
315 | copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); | ||
316 | } | ||
317 | return error; | ||
318 | } | ||
319 | |||
320 | #else | ||
321 | |||
322 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
323 | { | ||
324 | return -ENOSYS; | ||
325 | } | ||
326 | |||
327 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
328 | |||
329 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) | 268 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) |
330 | { | 269 | { |
331 | int ret = 0; | 270 | int ret = 0; |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 6ebc07976694..8a0be0bdebad 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table) | |||
272 | PTR sys_munlockall | 272 | PTR sys_munlockall |
273 | PTR sys_vhangup /* 6150 */ | 273 | PTR sys_vhangup /* 6150 */ |
274 | PTR sys_pivot_root | 274 | PTR sys_pivot_root |
275 | PTR sys_32_sysctl | 275 | PTR compat_sys_sysctl |
276 | PTR sys_prctl | 276 | PTR sys_prctl |
277 | PTR compat_sys_adjtimex | 277 | PTR compat_sys_adjtimex |
278 | PTR compat_sys_setrlimit /* 6155 */ | 278 | PTR compat_sys_setrlimit /* 6155 */ |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 14dde4ca932e..41dbdb7d67e5 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -356,7 +356,7 @@ sys_call_table: | |||
356 | PTR sys_ni_syscall /* 4150 */ | 356 | PTR sys_ni_syscall /* 4150 */ |
357 | PTR sys_getsid | 357 | PTR sys_getsid |
358 | PTR sys_fdatasync | 358 | PTR sys_fdatasync |
359 | PTR sys_32_sysctl | 359 | PTR compat_sys_sysctl |
360 | PTR sys_mlock | 360 | PTR sys_mlock |
361 | PTR sys_munlock /* 4155 */ | 361 | PTR sys_munlock /* 4155 */ |
362 | PTR sys_mlockall | 362 | PTR sys_mlockall |
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c index b3deed8db619..14b9a28a4aec 100644 --- a/arch/mips/lasat/sysctl.c +++ b/arch/mips/lasat/sysctl.c | |||
@@ -37,23 +37,6 @@ | |||
37 | #include "ds1603.h" | 37 | #include "ds1603.h" |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | /* Strategy function to write EEPROM after changing string entry */ | ||
41 | int sysctl_lasatstring(ctl_table *table, | ||
42 | void *oldval, size_t *oldlenp, | ||
43 | void *newval, size_t newlen) | ||
44 | { | ||
45 | int r; | ||
46 | |||
47 | r = sysctl_string(table, oldval, oldlenp, newval, newlen); | ||
48 | if (r < 0) | ||
49 | return r; | ||
50 | |||
51 | if (newval && newlen) | ||
52 | lasat_write_eeprom_info(); | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | 40 | ||
58 | /* And the same for proc */ | 41 | /* And the same for proc */ |
59 | int proc_dolasatstring(ctl_table *table, int write, | 42 | int proc_dolasatstring(ctl_table *table, int write, |
@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write, | |||
113 | } | 96 | } |
114 | #endif | 97 | #endif |
115 | 98 | ||
116 | /* Sysctl for setting the IP addresses */ | ||
117 | int sysctl_lasat_intvec(ctl_table *table, | ||
118 | void *oldval, size_t *oldlenp, | ||
119 | void *newval, size_t newlen) | ||
120 | { | ||
121 | int r; | ||
122 | |||
123 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); | ||
124 | if (r < 0) | ||
125 | return r; | ||
126 | |||
127 | if (newval && newlen) | ||
128 | lasat_write_eeprom_info(); | ||
129 | |||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | #ifdef CONFIG_DS1603 | ||
134 | /* Same for RTC */ | ||
135 | int sysctl_lasat_rtc(ctl_table *table, | ||
136 | void *oldval, size_t *oldlenp, | ||
137 | void *newval, size_t newlen) | ||
138 | { | ||
139 | struct timespec ts; | ||
140 | int r; | ||
141 | |||
142 | read_persistent_clock(&ts); | ||
143 | rtctmp = ts.tv_sec; | ||
144 | if (rtctmp < 0) | ||
145 | rtctmp = 0; | ||
146 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); | ||
147 | if (r < 0) | ||
148 | return r; | ||
149 | if (newval && newlen) | ||
150 | rtc_mips_set_mmss(rtctmp); | ||
151 | |||
152 | return r; | ||
153 | } | ||
154 | #endif | ||
155 | |||
156 | #ifdef CONFIG_INET | 99 | #ifdef CONFIG_INET |
157 | int proc_lasat_ip(ctl_table *table, int write, | 100 | int proc_lasat_ip(ctl_table *table, int write, |
158 | void *buffer, size_t *lenp, loff_t *ppos) | 101 | void *buffer, size_t *lenp, loff_t *ppos) |
@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write, | |||
214 | } | 157 | } |
215 | #endif | 158 | #endif |
216 | 159 | ||
217 | static int sysctl_lasat_prid(ctl_table *table, | ||
218 | void *oldval, size_t *oldlenp, | ||
219 | void *newval, size_t newlen) | ||
220 | { | ||
221 | int r; | ||
222 | |||
223 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); | ||
224 | if (r < 0) | ||
225 | return r; | ||
226 | if (newval && newlen) { | ||
227 | lasat_board_info.li_eeprom_info.prid = *(int *)newval; | ||
228 | lasat_write_eeprom_info(); | ||
229 | lasat_init_board_info(); | ||
230 | } | ||
231 | return 0; | ||
232 | } | ||
233 | |||
234 | int proc_lasat_prid(ctl_table *table, int write, | 160 | int proc_lasat_prid(ctl_table *table, int write, |
235 | void *buffer, size_t *lenp, loff_t *ppos) | 161 | void *buffer, size_t *lenp, loff_t *ppos) |
236 | { | 162 | { |
@@ -252,115 +178,92 @@ extern int lasat_boot_to_service; | |||
252 | 178 | ||
253 | static ctl_table lasat_table[] = { | 179 | static ctl_table lasat_table[] = { |
254 | { | 180 | { |
255 | .ctl_name = CTL_UNNUMBERED, | ||
256 | .procname = "cpu-hz", | 181 | .procname = "cpu-hz", |
257 | .data = &lasat_board_info.li_cpu_hz, | 182 | .data = &lasat_board_info.li_cpu_hz, |
258 | .maxlen = sizeof(int), | 183 | .maxlen = sizeof(int), |
259 | .mode = 0444, | 184 | .mode = 0444, |
260 | .proc_handler = &proc_dointvec, | 185 | .proc_handler = proc_dointvec, |
261 | .strategy = &sysctl_intvec | ||
262 | }, | 186 | }, |
263 | { | 187 | { |
264 | .ctl_name = CTL_UNNUMBERED, | ||
265 | .procname = "bus-hz", | 188 | .procname = "bus-hz", |
266 | .data = &lasat_board_info.li_bus_hz, | 189 | .data = &lasat_board_info.li_bus_hz, |
267 | .maxlen = sizeof(int), | 190 | .maxlen = sizeof(int), |
268 | .mode = 0444, | 191 | .mode = 0444, |
269 | .proc_handler = &proc_dointvec, | 192 | .proc_handler = proc_dointvec, |
270 | .strategy = &sysctl_intvec | ||
271 | }, | 193 | }, |
272 | { | 194 | { |
273 | .ctl_name = CTL_UNNUMBERED, | ||
274 | .procname = "bmid", | 195 | .procname = "bmid", |
275 | .data = &lasat_board_info.li_bmid, | 196 | .data = &lasat_board_info.li_bmid, |
276 | .maxlen = sizeof(int), | 197 | .maxlen = sizeof(int), |
277 | .mode = 0444, | 198 | .mode = 0444, |
278 | .proc_handler = &proc_dointvec, | 199 | .proc_handler = proc_dointvec, |
279 | .strategy = &sysctl_intvec | ||
280 | }, | 200 | }, |
281 | { | 201 | { |
282 | .ctl_name = CTL_UNNUMBERED, | ||
283 | .procname = "prid", | 202 | .procname = "prid", |
284 | .data = &lasat_board_info.li_prid, | 203 | .data = &lasat_board_info.li_prid, |
285 | .maxlen = sizeof(int), | 204 | .maxlen = sizeof(int), |
286 | .mode = 0644, | 205 | .mode = 0644, |
287 | .proc_handler = &proc_lasat_prid, | 206 | .proc_handler = proc_lasat_prid, |
288 | .strategy = &sysctl_lasat_prid | 207 | . }, |
289 | }, | ||
290 | #ifdef CONFIG_INET | 208 | #ifdef CONFIG_INET |
291 | { | 209 | { |
292 | .ctl_name = CTL_UNNUMBERED, | ||
293 | .procname = "ipaddr", | 210 | .procname = "ipaddr", |
294 | .data = &lasat_board_info.li_eeprom_info.ipaddr, | 211 | .data = &lasat_board_info.li_eeprom_info.ipaddr, |
295 | .maxlen = sizeof(int), | 212 | .maxlen = sizeof(int), |
296 | .mode = 0644, | 213 | .mode = 0644, |
297 | .proc_handler = &proc_lasat_ip, | 214 | .proc_handler = proc_lasat_ip, |
298 | .strategy = &sysctl_lasat_intvec | ||
299 | }, | 215 | }, |
300 | { | 216 | { |
301 | .ctl_name = CTL_UNNUMBERED, | ||
302 | .procname = "netmask", | 217 | .procname = "netmask", |
303 | .data = &lasat_board_info.li_eeprom_info.netmask, | 218 | .data = &lasat_board_info.li_eeprom_info.netmask, |
304 | .maxlen = sizeof(int), | 219 | .maxlen = sizeof(int), |
305 | .mode = 0644, | 220 | .mode = 0644, |
306 | .proc_handler = &proc_lasat_ip, | 221 | .proc_handler = proc_lasat_ip, |
307 | .strategy = &sysctl_lasat_intvec | ||
308 | }, | 222 | }, |
309 | #endif | 223 | #endif |
310 | { | 224 | { |
311 | .ctl_name = CTL_UNNUMBERED, | ||
312 | .procname = "passwd_hash", | 225 | .procname = "passwd_hash", |
313 | .data = &lasat_board_info.li_eeprom_info.passwd_hash, | 226 | .data = &lasat_board_info.li_eeprom_info.passwd_hash, |
314 | .maxlen = | 227 | .maxlen = |
315 | sizeof(lasat_board_info.li_eeprom_info.passwd_hash), | 228 | sizeof(lasat_board_info.li_eeprom_info.passwd_hash), |
316 | .mode = 0600, | 229 | .mode = 0600, |
317 | .proc_handler = &proc_dolasatstring, | 230 | .proc_handler = proc_dolasatstring, |
318 | .strategy = &sysctl_lasatstring | ||
319 | }, | 231 | }, |
320 | { | 232 | { |
321 | .ctl_name = CTL_UNNUMBERED, | ||
322 | .procname = "boot-service", | 233 | .procname = "boot-service", |
323 | .data = &lasat_boot_to_service, | 234 | .data = &lasat_boot_to_service, |
324 | .maxlen = sizeof(int), | 235 | .maxlen = sizeof(int), |
325 | .mode = 0644, | 236 | .mode = 0644, |
326 | .proc_handler = &proc_dointvec, | 237 | .proc_handler = proc_dointvec, |
327 | .strategy = &sysctl_intvec | ||
328 | }, | 238 | }, |
329 | #ifdef CONFIG_DS1603 | 239 | #ifdef CONFIG_DS1603 |
330 | { | 240 | { |
331 | .ctl_name = CTL_UNNUMBERED, | ||
332 | .procname = "rtc", | 241 | .procname = "rtc", |
333 | .data = &rtctmp, | 242 | .data = &rtctmp, |
334 | .maxlen = sizeof(int), | 243 | .maxlen = sizeof(int), |
335 | .mode = 0644, | 244 | .mode = 0644, |
336 | .proc_handler = &proc_dolasatrtc, | 245 | .proc_handler = proc_dolasatrtc, |
337 | .strategy = &sysctl_lasat_rtc | ||
338 | }, | 246 | }, |
339 | #endif | 247 | #endif |
340 | { | 248 | { |
341 | .ctl_name = CTL_UNNUMBERED, | ||
342 | .procname = "namestr", | 249 | .procname = "namestr", |
343 | .data = &lasat_board_info.li_namestr, | 250 | .data = &lasat_board_info.li_namestr, |
344 | .maxlen = sizeof(lasat_board_info.li_namestr), | 251 | .maxlen = sizeof(lasat_board_info.li_namestr), |
345 | .mode = 0444, | 252 | .mode = 0444, |
346 | .proc_handler = &proc_dostring, | 253 | .proc_handler = proc_dostring, |
347 | .strategy = &sysctl_string | ||
348 | }, | 254 | }, |
349 | { | 255 | { |
350 | .ctl_name = CTL_UNNUMBERED, | ||
351 | .procname = "typestr", | 256 | .procname = "typestr", |
352 | .data = &lasat_board_info.li_typestr, | 257 | .data = &lasat_board_info.li_typestr, |
353 | .maxlen = sizeof(lasat_board_info.li_typestr), | 258 | .maxlen = sizeof(lasat_board_info.li_typestr), |
354 | .mode = 0444, | 259 | .mode = 0444, |
355 | .proc_handler = &proc_dostring, | 260 | .proc_handler = proc_dostring, |
356 | .strategy = &sysctl_string | ||
357 | }, | 261 | }, |
358 | {} | 262 | {} |
359 | }; | 263 | }; |
360 | 264 | ||
361 | static ctl_table lasat_root_table[] = { | 265 | static ctl_table lasat_root_table[] = { |
362 | { | 266 | { |
363 | .ctl_name = CTL_UNNUMBERED, | ||
364 | .procname = "lasat", | 267 | .procname = "lasat", |
365 | .mode = 0555, | 268 | .mode = 0555, |
366 | .child = lasat_table | 269 | .child = lasat_table |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index 561388b17c91..76d23ec8dfaa 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
@@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, | |||
90 | return -ENOSYS; | 90 | return -ENOSYS; |
91 | } | 91 | } |
92 | 92 | ||
93 | #ifdef CONFIG_SYSCTL | ||
94 | |||
95 | struct __sysctl_args32 { | ||
96 | u32 name; | ||
97 | int nlen; | ||
98 | u32 oldval; | ||
99 | u32 oldlenp; | ||
100 | u32 newval; | ||
101 | u32 newlen; | ||
102 | u32 __unused[4]; | ||
103 | }; | ||
104 | |||
105 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | ||
106 | { | ||
107 | #ifndef CONFIG_SYSCTL_SYSCALL | ||
108 | return -ENOSYS; | ||
109 | #else | ||
110 | struct __sysctl_args32 tmp; | ||
111 | int error; | ||
112 | unsigned int oldlen32; | ||
113 | size_t oldlen, __user *oldlenp = NULL; | ||
114 | unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7; | ||
115 | |||
116 | DBG(("sysctl32(%p)\n", args)); | ||
117 | |||
118 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
119 | return -EFAULT; | ||
120 | |||
121 | if (tmp.oldval && tmp.oldlenp) { | ||
122 | /* Duh, this is ugly and might not work if sysctl_args | ||
123 | is in read-only memory, but do_sysctl does indirectly | ||
124 | a lot of uaccess in both directions and we'd have to | ||
125 | basically copy the whole sysctl.c here, and | ||
126 | glibc's __sysctl uses rw memory for the structure | ||
127 | anyway. */ | ||
128 | /* a possibly better hack than this, which will avoid the | ||
129 | * problem if the struct is read only, is to push the | ||
130 | * 'oldlen' value out to the user's stack instead. -PB | ||
131 | */ | ||
132 | if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp)) | ||
133 | return -EFAULT; | ||
134 | oldlen = oldlen32; | ||
135 | if (put_user(oldlen, (size_t *)addr)) | ||
136 | return -EFAULT; | ||
137 | oldlenp = (size_t *)addr; | ||
138 | } | ||
139 | |||
140 | lock_kernel(); | ||
141 | error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen, | ||
142 | (void __user *)(u64)tmp.oldval, oldlenp, | ||
143 | (void __user *)(u64)tmp.newval, tmp.newlen); | ||
144 | unlock_kernel(); | ||
145 | if (oldlenp) { | ||
146 | if (!error) { | ||
147 | if (get_user(oldlen, (size_t *)addr)) { | ||
148 | error = -EFAULT; | ||
149 | } else { | ||
150 | oldlen32 = oldlen; | ||
151 | if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp)) | ||
152 | error = -EFAULT; | ||
153 | } | ||
154 | } | ||
155 | if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) | ||
156 | error = -EFAULT; | ||
157 | } | ||
158 | return error; | ||
159 | #endif | ||
160 | } | ||
161 | |||
162 | #endif /* CONFIG_SYSCTL */ | ||
163 | |||
164 | asmlinkage long sys32_sched_rr_get_interval(pid_t pid, | 93 | asmlinkage long sys32_sched_rr_get_interval(pid_t pid, |
165 | struct compat_timespec __user *interval) | 94 | struct compat_timespec __user *interval) |
166 | { | 95 | { |
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 843f423dec67..01c4fcf8f481 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
@@ -234,7 +234,7 @@ | |||
234 | ENTRY_SAME(getsid) | 234 | ENTRY_SAME(getsid) |
235 | ENTRY_SAME(fdatasync) | 235 | ENTRY_SAME(fdatasync) |
236 | /* struct __sysctl_args is a mess */ | 236 | /* struct __sysctl_args is a mess */ |
237 | ENTRY_DIFF(sysctl) | 237 | ENTRY_COMP(sysctl) |
238 | ENTRY_SAME(mlock) /* 150 */ | 238 | ENTRY_SAME(mlock) /* 150 */ |
239 | ENTRY_SAME(munlock) | 239 | ENTRY_SAME(munlock) |
240 | ENTRY_SAME(mlockall) | 240 | ENTRY_SAME(mlockall) |
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c index 88d9c1d5e5fb..049dda60e475 100644 --- a/arch/powerpc/kernel/idle.c +++ b/arch/powerpc/kernel/idle.c | |||
@@ -110,18 +110,16 @@ int powersave_nap; | |||
110 | */ | 110 | */ |
111 | static ctl_table powersave_nap_ctl_table[]={ | 111 | static ctl_table powersave_nap_ctl_table[]={ |
112 | { | 112 | { |
113 | .ctl_name = KERN_PPC_POWERSAVE_NAP, | ||
114 | .procname = "powersave-nap", | 113 | .procname = "powersave-nap", |
115 | .data = &powersave_nap, | 114 | .data = &powersave_nap, |
116 | .maxlen = sizeof(int), | 115 | .maxlen = sizeof(int), |
117 | .mode = 0644, | 116 | .mode = 0644, |
118 | .proc_handler = &proc_dointvec, | 117 | .proc_handler = proc_dointvec, |
119 | }, | 118 | }, |
120 | {} | 119 | {} |
121 | }; | 120 | }; |
122 | static ctl_table powersave_nap_sysctl_root[] = { | 121 | static ctl_table powersave_nap_sysctl_root[] = { |
123 | { | 122 | { |
124 | .ctl_name = CTL_KERN, | ||
125 | .procname = "kernel", | 123 | .procname = "kernel", |
126 | .mode = 0555, | 124 | .mode = 0555, |
127 | .child = powersave_nap_ctl_table, | 125 | .child = powersave_nap_ctl_table, |
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index b97c2d67f4ac..c5a4732bcc48 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
@@ -520,58 +520,6 @@ asmlinkage long compat_sys_umask(u32 mask) | |||
520 | return sys_umask((int)mask); | 520 | return sys_umask((int)mask); |
521 | } | 521 | } |
522 | 522 | ||
523 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
524 | struct __sysctl_args32 { | ||
525 | u32 name; | ||
526 | int nlen; | ||
527 | u32 oldval; | ||
528 | u32 oldlenp; | ||
529 | u32 newval; | ||
530 | u32 newlen; | ||
531 | u32 __unused[4]; | ||
532 | }; | ||
533 | |||
534 | asmlinkage long compat_sys_sysctl(struct __sysctl_args32 __user *args) | ||
535 | { | ||
536 | struct __sysctl_args32 tmp; | ||
537 | int error; | ||
538 | size_t oldlen; | ||
539 | size_t __user *oldlenp = NULL; | ||
540 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7; | ||
541 | |||
542 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
543 | return -EFAULT; | ||
544 | |||
545 | if (tmp.oldval && tmp.oldlenp) { | ||
546 | /* Duh, this is ugly and might not work if sysctl_args | ||
547 | is in read-only memory, but do_sysctl does indirectly | ||
548 | a lot of uaccess in both directions and we'd have to | ||
549 | basically copy the whole sysctl.c here, and | ||
550 | glibc's __sysctl uses rw memory for the structure | ||
551 | anyway. */ | ||
552 | oldlenp = (size_t __user *)addr; | ||
553 | if (get_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)) || | ||
554 | put_user(oldlen, oldlenp)) | ||
555 | return -EFAULT; | ||
556 | } | ||
557 | |||
558 | lock_kernel(); | ||
559 | error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, | ||
560 | compat_ptr(tmp.oldval), oldlenp, | ||
561 | compat_ptr(tmp.newval), tmp.newlen); | ||
562 | unlock_kernel(); | ||
563 | if (oldlenp) { | ||
564 | if (!error) { | ||
565 | if (get_user(oldlen, oldlenp) || | ||
566 | put_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp))) | ||
567 | error = -EFAULT; | ||
568 | } | ||
569 | copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); | ||
570 | } | ||
571 | return error; | ||
572 | } | ||
573 | #endif | ||
574 | |||
575 | unsigned long compat_sys_mmap2(unsigned long addr, size_t len, | 523 | unsigned long compat_sys_mmap2(unsigned long addr, size_t len, |
576 | unsigned long prot, unsigned long flags, | 524 | unsigned long prot, unsigned long flags, |
577 | unsigned long fd, unsigned long pgoff) | 525 | unsigned long fd, unsigned long pgoff) |
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index b55fd7ed1c31..495589950dc7 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -61,12 +61,12 @@ static struct ctl_table appldata_table[] = { | |||
61 | { | 61 | { |
62 | .procname = "timer", | 62 | .procname = "timer", |
63 | .mode = S_IRUGO | S_IWUSR, | 63 | .mode = S_IRUGO | S_IWUSR, |
64 | .proc_handler = &appldata_timer_handler, | 64 | .proc_handler = appldata_timer_handler, |
65 | }, | 65 | }, |
66 | { | 66 | { |
67 | .procname = "interval", | 67 | .procname = "interval", |
68 | .mode = S_IRUGO | S_IWUSR, | 68 | .mode = S_IRUGO | S_IWUSR, |
69 | .proc_handler = &appldata_interval_handler, | 69 | .proc_handler = appldata_interval_handler, |
70 | }, | 70 | }, |
71 | { }, | 71 | { }, |
72 | }; | 72 | }; |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 0debcec23a39..fda1a8123f9b 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd, | |||
527 | return ret; | 527 | return ret; |
528 | } | 528 | } |
529 | 529 | ||
530 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
531 | struct __sysctl_args32 { | ||
532 | u32 name; | ||
533 | int nlen; | ||
534 | u32 oldval; | ||
535 | u32 oldlenp; | ||
536 | u32 newval; | ||
537 | u32 newlen; | ||
538 | u32 __unused[4]; | ||
539 | }; | ||
540 | |||
541 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | ||
542 | { | ||
543 | struct __sysctl_args32 tmp; | ||
544 | int error; | ||
545 | size_t oldlen; | ||
546 | size_t __user *oldlenp = NULL; | ||
547 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7; | ||
548 | |||
549 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
550 | return -EFAULT; | ||
551 | |||
552 | if (tmp.oldval && tmp.oldlenp) { | ||
553 | /* Duh, this is ugly and might not work if sysctl_args | ||
554 | is in read-only memory, but do_sysctl does indirectly | ||
555 | a lot of uaccess in both directions and we'd have to | ||
556 | basically copy the whole sysctl.c here, and | ||
557 | glibc's __sysctl uses rw memory for the structure | ||
558 | anyway. */ | ||
559 | if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) || | ||
560 | put_user(oldlen, (size_t __user *)addr)) | ||
561 | return -EFAULT; | ||
562 | oldlenp = (size_t __user *)addr; | ||
563 | } | ||
564 | |||
565 | lock_kernel(); | ||
566 | error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval), | ||
567 | oldlenp, compat_ptr(tmp.newval), tmp.newlen); | ||
568 | unlock_kernel(); | ||
569 | if (oldlenp) { | ||
570 | if (!error) { | ||
571 | if (get_user(oldlen, (size_t __user *)addr) || | ||
572 | put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) | ||
573 | error = -EFAULT; | ||
574 | } | ||
575 | if (copy_to_user(args->__unused, tmp.__unused, | ||
576 | sizeof(tmp.__unused))) | ||
577 | error = -EFAULT; | ||
578 | } | ||
579 | return error; | ||
580 | } | ||
581 | #endif | ||
582 | |||
583 | struct stat64_emu31 { | 530 | struct stat64_emu31 { |
584 | unsigned long long st_dev; | 531 | unsigned long long st_dev; |
585 | unsigned int __pad1; | 532 | unsigned int __pad1; |
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index c07f9ca05ade..45e9092b3aad 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
@@ -162,7 +162,6 @@ struct ucontext32 { | |||
162 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ | 162 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ |
163 | }; | 163 | }; |
164 | 164 | ||
165 | struct __sysctl_args32; | ||
166 | struct stat64_emu31; | 165 | struct stat64_emu31; |
167 | struct mmap_arg_struct_emu31; | 166 | struct mmap_arg_struct_emu31; |
168 | struct fadvise64_64_args; | 167 | struct fadvise64_64_args; |
@@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, | |||
212 | size_t count); | 211 | size_t count); |
213 | long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, | 212 | long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, |
214 | s32 count); | 213 | s32 count); |
215 | long sys32_sysctl(struct __sysctl_args32 __user *args); | ||
216 | long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); | 214 | long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); |
217 | long sys32_lstat64(char __user * filename, | 215 | long sys32_lstat64(char __user * filename, |
218 | struct stat64_emu31 __user * statbuf); | 216 | struct stat64_emu31 __user * statbuf); |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index cbd9901dc0f8..30de2d0e52bb 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper: | |||
689 | llgfr %r2,%r2 # unsigned int | 689 | llgfr %r2,%r2 # unsigned int |
690 | jg sys_fdatasync # branch to system call | 690 | jg sys_fdatasync # branch to system call |
691 | 691 | ||
692 | #sys32_sysctl_wrapper # tbd | ||
693 | |||
694 | .globl sys32_mlock_wrapper | 692 | .globl sys32_mlock_wrapper |
695 | sys32_mlock_wrapper: | 693 | sys32_mlock_wrapper: |
696 | llgfr %r2,%r2 # unsigned long | 694 | llgfr %r2,%r2 # unsigned long |
@@ -1087,8 +1085,8 @@ sys32_stime_wrapper: | |||
1087 | 1085 | ||
1088 | .globl sys32_sysctl_wrapper | 1086 | .globl sys32_sysctl_wrapper |
1089 | sys32_sysctl_wrapper: | 1087 | sys32_sysctl_wrapper: |
1090 | llgtr %r2,%r2 # struct __sysctl_args32 * | 1088 | llgtr %r2,%r2 # struct compat_sysctl_args * |
1091 | jg sys32_sysctl | 1089 | jg compat_sys_sysctl |
1092 | 1090 | ||
1093 | .globl sys32_fstat64_wrapper | 1091 | .globl sys32_fstat64_wrapper |
1094 | sys32_fstat64_wrapper: | 1092 | sys32_fstat64_wrapper: |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 20f282c911c2..071c81f179ef 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write, | |||
893 | 893 | ||
894 | static struct ctl_table s390dbf_table[] = { | 894 | static struct ctl_table s390dbf_table[] = { |
895 | { | 895 | { |
896 | .ctl_name = CTL_S390DBF_STOPPABLE, | ||
897 | .procname = "debug_stoppable", | 896 | .procname = "debug_stoppable", |
898 | .data = &debug_stoppable, | 897 | .data = &debug_stoppable, |
899 | .maxlen = sizeof(int), | 898 | .maxlen = sizeof(int), |
900 | .mode = S_IRUGO | S_IWUSR, | 899 | .mode = S_IRUGO | S_IWUSR, |
901 | .proc_handler = &proc_dointvec, | 900 | .proc_handler = proc_dointvec, |
902 | .strategy = &sysctl_intvec, | ||
903 | }, | 901 | }, |
904 | { | 902 | { |
905 | .ctl_name = CTL_S390DBF_ACTIVE, | ||
906 | .procname = "debug_active", | 903 | .procname = "debug_active", |
907 | .data = &debug_active, | 904 | .data = &debug_active, |
908 | .maxlen = sizeof(int), | 905 | .maxlen = sizeof(int), |
909 | .mode = S_IRUGO | S_IWUSR, | 906 | .mode = S_IRUGO | S_IWUSR, |
910 | .proc_handler = &s390dbf_procactive, | 907 | .proc_handler = s390dbf_procactive, |
911 | .strategy = &sysctl_intvec, | ||
912 | }, | 908 | }, |
913 | { .ctl_name = 0 } | 909 | { } |
914 | }; | 910 | }; |
915 | 911 | ||
916 | static struct ctl_table s390dbf_dir_table[] = { | 912 | static struct ctl_table s390dbf_dir_table[] = { |
917 | { | 913 | { |
918 | .ctl_name = CTL_S390DBF, | ||
919 | .procname = "s390dbf", | 914 | .procname = "s390dbf", |
920 | .maxlen = 0, | 915 | .maxlen = 0, |
921 | .mode = S_IRUGO | S_IXUGO, | 916 | .mode = S_IRUGO | S_IXUGO, |
922 | .child = s390dbf_table, | 917 | .child = s390dbf_table, |
923 | }, | 918 | }, |
924 | { .ctl_name = 0 } | 919 | { } |
925 | }; | 920 | }; |
926 | 921 | ||
927 | static struct ctl_table_header *s390dbf_sysctl_header; | 922 | static struct ctl_table_header *s390dbf_sysctl_header; |
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index b201135cc18c..ff58779bf7e9 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c | |||
@@ -343,30 +343,29 @@ static struct ctl_table cmm_table[] = { | |||
343 | { | 343 | { |
344 | .procname = "cmm_pages", | 344 | .procname = "cmm_pages", |
345 | .mode = 0644, | 345 | .mode = 0644, |
346 | .proc_handler = &cmm_pages_handler, | 346 | .proc_handler = cmm_pages_handler, |
347 | }, | 347 | }, |
348 | { | 348 | { |
349 | .procname = "cmm_timed_pages", | 349 | .procname = "cmm_timed_pages", |
350 | .mode = 0644, | 350 | .mode = 0644, |
351 | .proc_handler = &cmm_pages_handler, | 351 | .proc_handler = cmm_pages_handler, |
352 | }, | 352 | }, |
353 | { | 353 | { |
354 | .procname = "cmm_timeout", | 354 | .procname = "cmm_timeout", |
355 | .mode = 0644, | 355 | .mode = 0644, |
356 | .proc_handler = &cmm_timeout_handler, | 356 | .proc_handler = cmm_timeout_handler, |
357 | }, | 357 | }, |
358 | { .ctl_name = 0 } | 358 | { } |
359 | }; | 359 | }; |
360 | 360 | ||
361 | static struct ctl_table cmm_dir_table[] = { | 361 | static struct ctl_table cmm_dir_table[] = { |
362 | { | 362 | { |
363 | .ctl_name = CTL_VM, | ||
364 | .procname = "vm", | 363 | .procname = "vm", |
365 | .maxlen = 0, | 364 | .maxlen = 0, |
366 | .mode = 0555, | 365 | .mode = 0555, |
367 | .child = cmm_table, | 366 | .child = cmm_table, |
368 | }, | 367 | }, |
369 | { .ctl_name = 0 } | 368 | { } |
370 | }; | 369 | }; |
371 | #endif | 370 | #endif |
372 | 371 | ||
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c index 267e5ebbb475..75c0cbe2eda0 100644 --- a/arch/sh/kernel/traps_64.c +++ b/arch/sh/kernel/traps_64.c | |||
@@ -877,44 +877,39 @@ static int misaligned_fixup(struct pt_regs *regs) | |||
877 | 877 | ||
878 | static ctl_table unaligned_table[] = { | 878 | static ctl_table unaligned_table[] = { |
879 | { | 879 | { |
880 | .ctl_name = CTL_UNNUMBERED, | ||
881 | .procname = "kernel_reports", | 880 | .procname = "kernel_reports", |
882 | .data = &kernel_mode_unaligned_fixup_count, | 881 | .data = &kernel_mode_unaligned_fixup_count, |
883 | .maxlen = sizeof(int), | 882 | .maxlen = sizeof(int), |
884 | .mode = 0644, | 883 | .mode = 0644, |
885 | .proc_handler = &proc_dointvec | 884 | .proc_handler = proc_dointvec |
886 | }, | 885 | }, |
887 | { | 886 | { |
888 | .ctl_name = CTL_UNNUMBERED, | ||
889 | .procname = "user_reports", | 887 | .procname = "user_reports", |
890 | .data = &user_mode_unaligned_fixup_count, | 888 | .data = &user_mode_unaligned_fixup_count, |
891 | .maxlen = sizeof(int), | 889 | .maxlen = sizeof(int), |
892 | .mode = 0644, | 890 | .mode = 0644, |
893 | .proc_handler = &proc_dointvec | 891 | .proc_handler = proc_dointvec |
894 | }, | 892 | }, |
895 | { | 893 | { |
896 | .ctl_name = CTL_UNNUMBERED, | ||
897 | .procname = "user_enable", | 894 | .procname = "user_enable", |
898 | .data = &user_mode_unaligned_fixup_enable, | 895 | .data = &user_mode_unaligned_fixup_enable, |
899 | .maxlen = sizeof(int), | 896 | .maxlen = sizeof(int), |
900 | .mode = 0644, | 897 | .mode = 0644, |
901 | .proc_handler = &proc_dointvec}, | 898 | .proc_handler = proc_dointvec}, |
902 | {} | 899 | {} |
903 | }; | 900 | }; |
904 | 901 | ||
905 | static ctl_table unaligned_root[] = { | 902 | static ctl_table unaligned_root[] = { |
906 | { | 903 | { |
907 | .ctl_name = CTL_UNNUMBERED, | ||
908 | .procname = "unaligned_fixup", | 904 | .procname = "unaligned_fixup", |
909 | .mode = 0555, | 905 | .mode = 0555, |
910 | unaligned_table | 906 | .child = unaligned_table |
911 | }, | 907 | }, |
912 | {} | 908 | {} |
913 | }; | 909 | }; |
914 | 910 | ||
915 | static ctl_table sh64_root[] = { | 911 | static ctl_table sh64_root[] = { |
916 | { | 912 | { |
917 | .ctl_name = CTL_UNNUMBERED, | ||
918 | .procname = "sh64", | 913 | .procname = "sh64", |
919 | .mode = 0555, | 914 | .mode = 0555, |
920 | .child = unaligned_root | 915 | .child = unaligned_root |
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index 04e28b2671c8..f862372074bc 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c | |||
@@ -591,63 +591,6 @@ out: | |||
591 | return ret; | 591 | return ret; |
592 | } | 592 | } |
593 | 593 | ||
594 | struct __sysctl_args32 { | ||
595 | u32 name; | ||
596 | int nlen; | ||
597 | u32 oldval; | ||
598 | u32 oldlenp; | ||
599 | u32 newval; | ||
600 | u32 newlen; | ||
601 | u32 __unused[4]; | ||
602 | }; | ||
603 | |||
604 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | ||
605 | { | ||
606 | #ifndef CONFIG_SYSCTL_SYSCALL | ||
607 | return -ENOSYS; | ||
608 | #else | ||
609 | struct __sysctl_args32 tmp; | ||
610 | int error; | ||
611 | size_t oldlen, __user *oldlenp = NULL; | ||
612 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL; | ||
613 | |||
614 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
615 | return -EFAULT; | ||
616 | |||
617 | if (tmp.oldval && tmp.oldlenp) { | ||
618 | /* Duh, this is ugly and might not work if sysctl_args | ||
619 | is in read-only memory, but do_sysctl does indirectly | ||
620 | a lot of uaccess in both directions and we'd have to | ||
621 | basically copy the whole sysctl.c here, and | ||
622 | glibc's __sysctl uses rw memory for the structure | ||
623 | anyway. */ | ||
624 | if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) || | ||
625 | put_user(oldlen, (size_t __user *)addr)) | ||
626 | return -EFAULT; | ||
627 | oldlenp = (size_t __user *)addr; | ||
628 | } | ||
629 | |||
630 | lock_kernel(); | ||
631 | error = do_sysctl((int __user *)(unsigned long) tmp.name, | ||
632 | tmp.nlen, | ||
633 | (void __user *)(unsigned long) tmp.oldval, | ||
634 | oldlenp, | ||
635 | (void __user *)(unsigned long) tmp.newval, | ||
636 | tmp.newlen); | ||
637 | unlock_kernel(); | ||
638 | if (oldlenp) { | ||
639 | if (!error) { | ||
640 | if (get_user(oldlen, (size_t __user *)addr) || | ||
641 | put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp)) | ||
642 | error = -EFAULT; | ||
643 | } | ||
644 | if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) | ||
645 | error = -EFAULT; | ||
646 | } | ||
647 | return error; | ||
648 | #endif | ||
649 | } | ||
650 | |||
651 | long sys32_lookup_dcookie(unsigned long cookie_high, | 594 | long sys32_lookup_dcookie(unsigned long cookie_high, |
652 | unsigned long cookie_low, | 595 | unsigned long cookie_low, |
653 | char __user *buf, size_t len) | 596 | char __user *buf, size_t len) |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 009825f6e73c..034b10e0d4b0 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -68,7 +68,7 @@ sys_call_table32: | |||
68 | .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall | 68 | .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall |
69 | /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler | 69 | /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler |
70 | .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep | 70 | .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep |
71 | /*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl | 71 | /*250*/ .word sys32_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl |
72 | .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep | 72 | .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep |
73 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun | 73 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun |
74 | .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy | 74 | .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 581b0568fe19..5d2584839be4 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -653,7 +653,7 @@ ia32_sys_call_table: | |||
653 | .quad compat_sys_writev | 653 | .quad compat_sys_writev |
654 | .quad sys_getsid | 654 | .quad sys_getsid |
655 | .quad sys_fdatasync | 655 | .quad sys_fdatasync |
656 | .quad sys32_sysctl /* sysctl */ | 656 | .quad compat_sys_sysctl /* sysctl */ |
657 | .quad sys_mlock /* 150 */ | 657 | .quad sys_mlock /* 150 */ |
658 | .quad sys_munlock | 658 | .quad sys_munlock |
659 | .quad sys_mlockall | 659 | .quad sys_mlockall |
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index 9f5527198825..df82c0e48ded 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
@@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig, | |||
434 | return ret; | 434 | return ret; |
435 | } | 435 | } |
436 | 436 | ||
437 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
438 | struct sysctl_ia32 { | ||
439 | unsigned int name; | ||
440 | int nlen; | ||
441 | unsigned int oldval; | ||
442 | unsigned int oldlenp; | ||
443 | unsigned int newval; | ||
444 | unsigned int newlen; | ||
445 | unsigned int __unused[4]; | ||
446 | }; | ||
447 | |||
448 | |||
449 | asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32) | ||
450 | { | ||
451 | struct sysctl_ia32 a32; | ||
452 | mm_segment_t old_fs = get_fs(); | ||
453 | void __user *oldvalp, *newvalp; | ||
454 | size_t oldlen; | ||
455 | int __user *namep; | ||
456 | long ret; | ||
457 | |||
458 | if (copy_from_user(&a32, args32, sizeof(a32))) | ||
459 | return -EFAULT; | ||
460 | |||
461 | /* | ||
462 | * We need to pre-validate these because we have to disable | ||
463 | * address checking before calling do_sysctl() because of | ||
464 | * OLDLEN but we can't run the risk of the user specifying bad | ||
465 | * addresses here. Well, since we're dealing with 32 bit | ||
466 | * addresses, we KNOW that access_ok() will always succeed, so | ||
467 | * this is an expensive NOP, but so what... | ||
468 | */ | ||
469 | namep = compat_ptr(a32.name); | ||
470 | oldvalp = compat_ptr(a32.oldval); | ||
471 | newvalp = compat_ptr(a32.newval); | ||
472 | |||
473 | if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp))) | ||
474 | || !access_ok(VERIFY_WRITE, namep, 0) | ||
475 | || !access_ok(VERIFY_WRITE, oldvalp, 0) | ||
476 | || !access_ok(VERIFY_WRITE, newvalp, 0)) | ||
477 | return -EFAULT; | ||
478 | |||
479 | set_fs(KERNEL_DS); | ||
480 | lock_kernel(); | ||
481 | ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen, | ||
482 | newvalp, (size_t) a32.newlen); | ||
483 | unlock_kernel(); | ||
484 | set_fs(old_fs); | ||
485 | |||
486 | if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp))) | ||
487 | return -EFAULT; | ||
488 | |||
489 | return ret; | ||
490 | } | ||
491 | #endif | ||
492 | |||
493 | /* warning: next two assume little endian */ | 437 | /* warning: next two assume little endian */ |
494 | asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, | 438 | asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, |
495 | u32 poslo, u32 poshi) | 439 | u32 poslo, u32 poshi) |
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h index 72a6dcd1299b..9af9decb38c3 100644 --- a/arch/x86/include/asm/sys_ia32.h +++ b/arch/x86/include/asm/sys_ia32.h | |||
@@ -51,11 +51,6 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t, | |||
51 | asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t); | 51 | asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t); |
52 | asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); | 52 | asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); |
53 | 53 | ||
54 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
55 | struct sysctl_ia32; | ||
56 | asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *); | ||
57 | #endif | ||
58 | |||
59 | asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); | 54 | asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); |
60 | asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32); | 55 | asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32); |
61 | 56 | ||
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index 8cb4974ff599..e02d92d12bcd 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c | |||
@@ -237,7 +237,7 @@ static ctl_table kernel_table2[] = { | |||
237 | }; | 237 | }; |
238 | 238 | ||
239 | static ctl_table kernel_root_table2[] = { | 239 | static ctl_table kernel_root_table2[] = { |
240 | { .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555, | 240 | { .procname = "kernel", .mode = 0555, |
241 | .child = kernel_table2 }, | 241 | .child = kernel_table2 }, |
242 | {} | 242 | {} |
243 | }; | 243 | }; |
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index 58bc00f68b12..02b442e92007 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c | |||
@@ -393,7 +393,6 @@ static ctl_table abi_table2[] = { | |||
393 | 393 | ||
394 | static ctl_table abi_root_table2[] = { | 394 | static ctl_table abi_root_table2[] = { |
395 | { | 395 | { |
396 | .ctl_name = CTL_ABI, | ||
397 | .procname = "abi", | 396 | .procname = "abi", |
398 | .mode = 0555, | 397 | .mode = 0555, |
399 | .child = abi_table2 | 398 | .child = abi_table2 |
diff --git a/crypto/proc.c b/crypto/proc.c index 5dc07e442fca..1c38733c224d 100644 --- a/crypto/proc.c +++ b/crypto/proc.c | |||
@@ -25,28 +25,22 @@ | |||
25 | #ifdef CONFIG_CRYPTO_FIPS | 25 | #ifdef CONFIG_CRYPTO_FIPS |
26 | static struct ctl_table crypto_sysctl_table[] = { | 26 | static struct ctl_table crypto_sysctl_table[] = { |
27 | { | 27 | { |
28 | .ctl_name = CTL_UNNUMBERED, | ||
29 | .procname = "fips_enabled", | 28 | .procname = "fips_enabled", |
30 | .data = &fips_enabled, | 29 | .data = &fips_enabled, |
31 | .maxlen = sizeof(int), | 30 | .maxlen = sizeof(int), |
32 | .mode = 0444, | 31 | .mode = 0444, |
33 | .proc_handler = &proc_dointvec | 32 | .proc_handler = proc_dointvec |
34 | }, | ||
35 | { | ||
36 | .ctl_name = 0, | ||
37 | }, | 33 | }, |
34 | {} | ||
38 | }; | 35 | }; |
39 | 36 | ||
40 | static struct ctl_table crypto_dir_table[] = { | 37 | static struct ctl_table crypto_dir_table[] = { |
41 | { | 38 | { |
42 | .ctl_name = CTL_UNNUMBERED, | ||
43 | .procname = "crypto", | 39 | .procname = "crypto", |
44 | .mode = 0555, | 40 | .mode = 0555, |
45 | .child = crypto_sysctl_table | 41 | .child = crypto_sysctl_table |
46 | }, | 42 | }, |
47 | { | 43 | {} |
48 | .ctl_name = 0, | ||
49 | }, | ||
50 | }; | 44 | }; |
51 | 45 | ||
52 | static struct ctl_table_header *crypto_sysctls; | 46 | static struct ctl_table_header *crypto_sysctls; |
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 614da5b8613a..e3749d0ba68b 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -3557,67 +3557,65 @@ static ctl_table cdrom_table[] = { | |||
3557 | .data = &cdrom_sysctl_settings.info, | 3557 | .data = &cdrom_sysctl_settings.info, |
3558 | .maxlen = CDROM_STR_SIZE, | 3558 | .maxlen = CDROM_STR_SIZE, |
3559 | .mode = 0444, | 3559 | .mode = 0444, |
3560 | .proc_handler = &cdrom_sysctl_info, | 3560 | .proc_handler = cdrom_sysctl_info, |
3561 | }, | 3561 | }, |
3562 | { | 3562 | { |
3563 | .procname = "autoclose", | 3563 | .procname = "autoclose", |
3564 | .data = &cdrom_sysctl_settings.autoclose, | 3564 | .data = &cdrom_sysctl_settings.autoclose, |
3565 | .maxlen = sizeof(int), | 3565 | .maxlen = sizeof(int), |
3566 | .mode = 0644, | 3566 | .mode = 0644, |
3567 | .proc_handler = &cdrom_sysctl_handler, | 3567 | .proc_handler = cdrom_sysctl_handler, |
3568 | }, | 3568 | }, |
3569 | { | 3569 | { |
3570 | .procname = "autoeject", | 3570 | .procname = "autoeject", |
3571 | .data = &cdrom_sysctl_settings.autoeject, | 3571 | .data = &cdrom_sysctl_settings.autoeject, |
3572 | .maxlen = sizeof(int), | 3572 | .maxlen = sizeof(int), |
3573 | .mode = 0644, | 3573 | .mode = 0644, |
3574 | .proc_handler = &cdrom_sysctl_handler, | 3574 | .proc_handler = cdrom_sysctl_handler, |
3575 | }, | 3575 | }, |
3576 | { | 3576 | { |
3577 | .procname = "debug", | 3577 | .procname = "debug", |
3578 | .data = &cdrom_sysctl_settings.debug, | 3578 | .data = &cdrom_sysctl_settings.debug, |
3579 | .maxlen = sizeof(int), | 3579 | .maxlen = sizeof(int), |
3580 | .mode = 0644, | 3580 | .mode = 0644, |
3581 | .proc_handler = &cdrom_sysctl_handler, | 3581 | .proc_handler = cdrom_sysctl_handler, |
3582 | }, | 3582 | }, |
3583 | { | 3583 | { |
3584 | .procname = "lock", | 3584 | .procname = "lock", |
3585 | .data = &cdrom_sysctl_settings.lock, | 3585 | .data = &cdrom_sysctl_settings.lock, |
3586 | .maxlen = sizeof(int), | 3586 | .maxlen = sizeof(int), |
3587 | .mode = 0644, | 3587 | .mode = 0644, |
3588 | .proc_handler = &cdrom_sysctl_handler, | 3588 | .proc_handler = cdrom_sysctl_handler, |
3589 | }, | 3589 | }, |
3590 | { | 3590 | { |
3591 | .procname = "check_media", | 3591 | .procname = "check_media", |
3592 | .data = &cdrom_sysctl_settings.check, | 3592 | .data = &cdrom_sysctl_settings.check, |
3593 | .maxlen = sizeof(int), | 3593 | .maxlen = sizeof(int), |
3594 | .mode = 0644, | 3594 | .mode = 0644, |
3595 | .proc_handler = &cdrom_sysctl_handler | 3595 | .proc_handler = cdrom_sysctl_handler |
3596 | }, | 3596 | }, |
3597 | { .ctl_name = 0 } | 3597 | { } |
3598 | }; | 3598 | }; |
3599 | 3599 | ||
3600 | static ctl_table cdrom_cdrom_table[] = { | 3600 | static ctl_table cdrom_cdrom_table[] = { |
3601 | { | 3601 | { |
3602 | .ctl_name = DEV_CDROM, | ||
3603 | .procname = "cdrom", | 3602 | .procname = "cdrom", |
3604 | .maxlen = 0, | 3603 | .maxlen = 0, |
3605 | .mode = 0555, | 3604 | .mode = 0555, |
3606 | .child = cdrom_table, | 3605 | .child = cdrom_table, |
3607 | }, | 3606 | }, |
3608 | { .ctl_name = 0 } | 3607 | { } |
3609 | }; | 3608 | }; |
3610 | 3609 | ||
3611 | /* Make sure that /proc/sys/dev is there */ | 3610 | /* Make sure that /proc/sys/dev is there */ |
3612 | static ctl_table cdrom_root_table[] = { | 3611 | static ctl_table cdrom_root_table[] = { |
3613 | { | 3612 | { |
3614 | .ctl_name = CTL_DEV, | ||
3615 | .procname = "dev", | 3613 | .procname = "dev", |
3616 | .maxlen = 0, | 3614 | .maxlen = 0, |
3617 | .mode = 0555, | 3615 | .mode = 0555, |
3618 | .child = cdrom_cdrom_table, | 3616 | .child = cdrom_cdrom_table, |
3619 | }, | 3617 | }, |
3620 | { .ctl_name = 0 } | 3618 | { } |
3621 | }; | 3619 | }; |
3622 | static struct ctl_table_header *cdrom_sysctl_header; | 3620 | static struct ctl_table_header *cdrom_sysctl_header; |
3623 | 3621 | ||
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 70a770ac0138..e481c5938bad 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp) | |||
675 | 675 | ||
676 | static ctl_table hpet_table[] = { | 676 | static ctl_table hpet_table[] = { |
677 | { | 677 | { |
678 | .ctl_name = CTL_UNNUMBERED, | ||
679 | .procname = "max-user-freq", | 678 | .procname = "max-user-freq", |
680 | .data = &hpet_max_freq, | 679 | .data = &hpet_max_freq, |
681 | .maxlen = sizeof(int), | 680 | .maxlen = sizeof(int), |
682 | .mode = 0644, | 681 | .mode = 0644, |
683 | .proc_handler = &proc_dointvec, | 682 | .proc_handler = proc_dointvec, |
684 | }, | 683 | }, |
685 | {.ctl_name = 0} | 684 | {} |
686 | }; | 685 | }; |
687 | 686 | ||
688 | static ctl_table hpet_root[] = { | 687 | static ctl_table hpet_root[] = { |
689 | { | 688 | { |
690 | .ctl_name = CTL_UNNUMBERED, | ||
691 | .procname = "hpet", | 689 | .procname = "hpet", |
692 | .maxlen = 0, | 690 | .maxlen = 0, |
693 | .mode = 0555, | 691 | .mode = 0555, |
694 | .child = hpet_table, | 692 | .child = hpet_table, |
695 | }, | 693 | }, |
696 | {.ctl_name = 0} | 694 | {} |
697 | }; | 695 | }; |
698 | 696 | ||
699 | static ctl_table dev_root[] = { | 697 | static ctl_table dev_root[] = { |
700 | { | 698 | { |
701 | .ctl_name = CTL_DEV, | ||
702 | .procname = "dev", | 699 | .procname = "dev", |
703 | .maxlen = 0, | 700 | .maxlen = 0, |
704 | .mode = 0555, | 701 | .mode = 0555, |
705 | .child = hpet_root, | 702 | .child = hpet_root, |
706 | }, | 703 | }, |
707 | {.ctl_name = 0} | 704 | {} |
708 | }; | 705 | }; |
709 | 706 | ||
710 | static struct ctl_table_header *sysctl_header; | 707 | static struct ctl_table_header *sysctl_header; |
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c index 2e66b5f773dd..0dec5da000ef 100644 --- a/drivers/char/ipmi/ipmi_poweroff.c +++ b/drivers/char/ipmi/ipmi_poweroff.c | |||
@@ -660,26 +660,23 @@ static struct ipmi_smi_watcher smi_watcher = { | |||
660 | #include <linux/sysctl.h> | 660 | #include <linux/sysctl.h> |
661 | 661 | ||
662 | static ctl_table ipmi_table[] = { | 662 | static ctl_table ipmi_table[] = { |
663 | { .ctl_name = DEV_IPMI_POWEROFF_POWERCYCLE, | 663 | { .procname = "poweroff_powercycle", |
664 | .procname = "poweroff_powercycle", | ||
665 | .data = &poweroff_powercycle, | 664 | .data = &poweroff_powercycle, |
666 | .maxlen = sizeof(poweroff_powercycle), | 665 | .maxlen = sizeof(poweroff_powercycle), |
667 | .mode = 0644, | 666 | .mode = 0644, |
668 | .proc_handler = &proc_dointvec }, | 667 | .proc_handler = proc_dointvec }, |
669 | { } | 668 | { } |
670 | }; | 669 | }; |
671 | 670 | ||
672 | static ctl_table ipmi_dir_table[] = { | 671 | static ctl_table ipmi_dir_table[] = { |
673 | { .ctl_name = DEV_IPMI, | 672 | { .procname = "ipmi", |
674 | .procname = "ipmi", | ||
675 | .mode = 0555, | 673 | .mode = 0555, |
676 | .child = ipmi_table }, | 674 | .child = ipmi_table }, |
677 | { } | 675 | { } |
678 | }; | 676 | }; |
679 | 677 | ||
680 | static ctl_table ipmi_root_table[] = { | 678 | static ctl_table ipmi_root_table[] = { |
681 | { .ctl_name = CTL_DEV, | 679 | { .procname = "dev", |
682 | .procname = "dev", | ||
683 | .mode = 0555, | 680 | .mode = 0555, |
684 | .child = ipmi_dir_table }, | 681 | .child = ipmi_dir_table }, |
685 | { } | 682 | { } |
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 62f282e67638..d86c0bc05c1c 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -431,30 +431,25 @@ static struct cdev ptmx_cdev; | |||
431 | 431 | ||
432 | static struct ctl_table pty_table[] = { | 432 | static struct ctl_table pty_table[] = { |
433 | { | 433 | { |
434 | .ctl_name = PTY_MAX, | ||
435 | .procname = "max", | 434 | .procname = "max", |
436 | .maxlen = sizeof(int), | 435 | .maxlen = sizeof(int), |
437 | .mode = 0644, | 436 | .mode = 0644, |
438 | .data = &pty_limit, | 437 | .data = &pty_limit, |
439 | .proc_handler = &proc_dointvec_minmax, | 438 | .proc_handler = proc_dointvec_minmax, |
440 | .strategy = &sysctl_intvec, | ||
441 | .extra1 = &pty_limit_min, | 439 | .extra1 = &pty_limit_min, |
442 | .extra2 = &pty_limit_max, | 440 | .extra2 = &pty_limit_max, |
443 | }, { | 441 | }, { |
444 | .ctl_name = PTY_NR, | ||
445 | .procname = "nr", | 442 | .procname = "nr", |
446 | .maxlen = sizeof(int), | 443 | .maxlen = sizeof(int), |
447 | .mode = 0444, | 444 | .mode = 0444, |
448 | .data = &pty_count, | 445 | .data = &pty_count, |
449 | .proc_handler = &proc_dointvec, | 446 | .proc_handler = proc_dointvec, |
450 | }, { | 447 | }, |
451 | .ctl_name = 0 | 448 | {} |
452 | } | ||
453 | }; | 449 | }; |
454 | 450 | ||
455 | static struct ctl_table pty_kern_table[] = { | 451 | static struct ctl_table pty_kern_table[] = { |
456 | { | 452 | { |
457 | .ctl_name = KERN_PTY, | ||
458 | .procname = "pty", | 453 | .procname = "pty", |
459 | .mode = 0555, | 454 | .mode = 0555, |
460 | .child = pty_table, | 455 | .child = pty_table, |
@@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = { | |||
464 | 459 | ||
465 | static struct ctl_table pty_root_table[] = { | 460 | static struct ctl_table pty_root_table[] = { |
466 | { | 461 | { |
467 | .ctl_name = CTL_KERN, | ||
468 | .procname = "kernel", | 462 | .procname = "kernel", |
469 | .mode = 0555, | 463 | .mode = 0555, |
470 | .child = pty_kern_table, | 464 | .child = pty_kern_table, |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 04b505e5a5e2..dcd08635cf1b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1257,94 +1257,54 @@ static int proc_do_uuid(ctl_table *table, int write, | |||
1257 | return proc_dostring(&fake_table, write, buffer, lenp, ppos); | 1257 | return proc_dostring(&fake_table, write, buffer, lenp, ppos); |
1258 | } | 1258 | } |
1259 | 1259 | ||
1260 | static int uuid_strategy(ctl_table *table, | ||
1261 | void __user *oldval, size_t __user *oldlenp, | ||
1262 | void __user *newval, size_t newlen) | ||
1263 | { | ||
1264 | unsigned char tmp_uuid[16], *uuid; | ||
1265 | unsigned int len; | ||
1266 | |||
1267 | if (!oldval || !oldlenp) | ||
1268 | return 1; | ||
1269 | |||
1270 | uuid = table->data; | ||
1271 | if (!uuid) { | ||
1272 | uuid = tmp_uuid; | ||
1273 | uuid[8] = 0; | ||
1274 | } | ||
1275 | if (uuid[8] == 0) | ||
1276 | generate_random_uuid(uuid); | ||
1277 | |||
1278 | if (get_user(len, oldlenp)) | ||
1279 | return -EFAULT; | ||
1280 | if (len) { | ||
1281 | if (len > 16) | ||
1282 | len = 16; | ||
1283 | if (copy_to_user(oldval, uuid, len) || | ||
1284 | put_user(len, oldlenp)) | ||
1285 | return -EFAULT; | ||
1286 | } | ||
1287 | return 1; | ||
1288 | } | ||
1289 | |||
1290 | static int sysctl_poolsize = INPUT_POOL_WORDS * 32; | 1260 | static int sysctl_poolsize = INPUT_POOL_WORDS * 32; |
1291 | ctl_table random_table[] = { | 1261 | ctl_table random_table[] = { |
1292 | { | 1262 | { |
1293 | .ctl_name = RANDOM_POOLSIZE, | ||
1294 | .procname = "poolsize", | 1263 | .procname = "poolsize", |
1295 | .data = &sysctl_poolsize, | 1264 | .data = &sysctl_poolsize, |
1296 | .maxlen = sizeof(int), | 1265 | .maxlen = sizeof(int), |
1297 | .mode = 0444, | 1266 | .mode = 0444, |
1298 | .proc_handler = &proc_dointvec, | 1267 | .proc_handler = proc_dointvec, |
1299 | }, | 1268 | }, |
1300 | { | 1269 | { |
1301 | .ctl_name = RANDOM_ENTROPY_COUNT, | ||
1302 | .procname = "entropy_avail", | 1270 | .procname = "entropy_avail", |
1303 | .maxlen = sizeof(int), | 1271 | .maxlen = sizeof(int), |
1304 | .mode = 0444, | 1272 | .mode = 0444, |
1305 | .proc_handler = &proc_dointvec, | 1273 | .proc_handler = proc_dointvec, |
1306 | .data = &input_pool.entropy_count, | 1274 | .data = &input_pool.entropy_count, |
1307 | }, | 1275 | }, |
1308 | { | 1276 | { |
1309 | .ctl_name = RANDOM_READ_THRESH, | ||
1310 | .procname = "read_wakeup_threshold", | 1277 | .procname = "read_wakeup_threshold", |
1311 | .data = &random_read_wakeup_thresh, | 1278 | .data = &random_read_wakeup_thresh, |
1312 | .maxlen = sizeof(int), | 1279 | .maxlen = sizeof(int), |
1313 | .mode = 0644, | 1280 | .mode = 0644, |
1314 | .proc_handler = &proc_dointvec_minmax, | 1281 | .proc_handler = proc_dointvec_minmax, |
1315 | .strategy = &sysctl_intvec, | ||
1316 | .extra1 = &min_read_thresh, | 1282 | .extra1 = &min_read_thresh, |
1317 | .extra2 = &max_read_thresh, | 1283 | .extra2 = &max_read_thresh, |
1318 | }, | 1284 | }, |
1319 | { | 1285 | { |
1320 | .ctl_name = RANDOM_WRITE_THRESH, | ||
1321 | .procname = "write_wakeup_threshold", | 1286 | .procname = "write_wakeup_threshold", |
1322 | .data = &random_write_wakeup_thresh, | 1287 | .data = &random_write_wakeup_thresh, |
1323 | .maxlen = sizeof(int), | 1288 | .maxlen = sizeof(int), |
1324 | .mode = 0644, | 1289 | .mode = 0644, |
1325 | .proc_handler = &proc_dointvec_minmax, | 1290 | .proc_handler = proc_dointvec_minmax, |
1326 | .strategy = &sysctl_intvec, | ||
1327 | .extra1 = &min_write_thresh, | 1291 | .extra1 = &min_write_thresh, |
1328 | .extra2 = &max_write_thresh, | 1292 | .extra2 = &max_write_thresh, |
1329 | }, | 1293 | }, |
1330 | { | 1294 | { |
1331 | .ctl_name = RANDOM_BOOT_ID, | ||
1332 | .procname = "boot_id", | 1295 | .procname = "boot_id", |
1333 | .data = &sysctl_bootid, | 1296 | .data = &sysctl_bootid, |
1334 | .maxlen = 16, | 1297 | .maxlen = 16, |
1335 | .mode = 0444, | 1298 | .mode = 0444, |
1336 | .proc_handler = &proc_do_uuid, | 1299 | .proc_handler = proc_do_uuid, |
1337 | .strategy = &uuid_strategy, | ||
1338 | }, | 1300 | }, |
1339 | { | 1301 | { |
1340 | .ctl_name = RANDOM_UUID, | ||
1341 | .procname = "uuid", | 1302 | .procname = "uuid", |
1342 | .maxlen = 16, | 1303 | .maxlen = 16, |
1343 | .mode = 0444, | 1304 | .mode = 0444, |
1344 | .proc_handler = &proc_do_uuid, | 1305 | .proc_handler = proc_do_uuid, |
1345 | .strategy = &uuid_strategy, | ||
1346 | }, | 1306 | }, |
1347 | { .ctl_name = 0 } | 1307 | { } |
1348 | }; | 1308 | }; |
1349 | #endif /* CONFIG_SYSCTL */ | 1309 | #endif /* CONFIG_SYSCTL */ |
1350 | 1310 | ||
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index bc4ab3e54550..95acb8c880f4 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id) | |||
282 | */ | 282 | */ |
283 | static ctl_table rtc_table[] = { | 283 | static ctl_table rtc_table[] = { |
284 | { | 284 | { |
285 | .ctl_name = CTL_UNNUMBERED, | ||
286 | .procname = "max-user-freq", | 285 | .procname = "max-user-freq", |
287 | .data = &rtc_max_user_freq, | 286 | .data = &rtc_max_user_freq, |
288 | .maxlen = sizeof(int), | 287 | .maxlen = sizeof(int), |
289 | .mode = 0644, | 288 | .mode = 0644, |
290 | .proc_handler = &proc_dointvec, | 289 | .proc_handler = proc_dointvec, |
291 | }, | 290 | }, |
292 | { .ctl_name = 0 } | 291 | { } |
293 | }; | 292 | }; |
294 | 293 | ||
295 | static ctl_table rtc_root[] = { | 294 | static ctl_table rtc_root[] = { |
296 | { | 295 | { |
297 | .ctl_name = CTL_UNNUMBERED, | ||
298 | .procname = "rtc", | 296 | .procname = "rtc", |
299 | .mode = 0555, | 297 | .mode = 0555, |
300 | .child = rtc_table, | 298 | .child = rtc_table, |
301 | }, | 299 | }, |
302 | { .ctl_name = 0 } | 300 | { } |
303 | }; | 301 | }; |
304 | 302 | ||
305 | static ctl_table dev_root[] = { | 303 | static ctl_table dev_root[] = { |
306 | { | 304 | { |
307 | .ctl_name = CTL_DEV, | ||
308 | .procname = "dev", | 305 | .procname = "dev", |
309 | .mode = 0555, | 306 | .mode = 0555, |
310 | .child = rtc_root, | 307 | .child = rtc_root, |
311 | }, | 308 | }, |
312 | { .ctl_name = 0 } | 309 | { } |
313 | }; | 310 | }; |
314 | 311 | ||
315 | static struct ctl_table_header *sysctl_header; | 312 | static struct ctl_table_header *sysctl_header; |
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index cc9f27514aef..7b4ef5bb556b 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c | |||
@@ -27,54 +27,49 @@ static int mouse_last_keycode; | |||
27 | /* file(s) in /proc/sys/dev/mac_hid */ | 27 | /* file(s) in /proc/sys/dev/mac_hid */ |
28 | static ctl_table mac_hid_files[] = { | 28 | static ctl_table mac_hid_files[] = { |
29 | { | 29 | { |
30 | .ctl_name = DEV_MAC_HID_MOUSE_BUTTON_EMULATION, | ||
31 | .procname = "mouse_button_emulation", | 30 | .procname = "mouse_button_emulation", |
32 | .data = &mouse_emulate_buttons, | 31 | .data = &mouse_emulate_buttons, |
33 | .maxlen = sizeof(int), | 32 | .maxlen = sizeof(int), |
34 | .mode = 0644, | 33 | .mode = 0644, |
35 | .proc_handler = &proc_dointvec, | 34 | .proc_handler = proc_dointvec, |
36 | }, | 35 | }, |
37 | { | 36 | { |
38 | .ctl_name = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, | ||
39 | .procname = "mouse_button2_keycode", | 37 | .procname = "mouse_button2_keycode", |
40 | .data = &mouse_button2_keycode, | 38 | .data = &mouse_button2_keycode, |
41 | .maxlen = sizeof(int), | 39 | .maxlen = sizeof(int), |
42 | .mode = 0644, | 40 | .mode = 0644, |
43 | .proc_handler = &proc_dointvec, | 41 | .proc_handler = proc_dointvec, |
44 | }, | 42 | }, |
45 | { | 43 | { |
46 | .ctl_name = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, | ||
47 | .procname = "mouse_button3_keycode", | 44 | .procname = "mouse_button3_keycode", |
48 | .data = &mouse_button3_keycode, | 45 | .data = &mouse_button3_keycode, |
49 | .maxlen = sizeof(int), | 46 | .maxlen = sizeof(int), |
50 | .mode = 0644, | 47 | .mode = 0644, |
51 | .proc_handler = &proc_dointvec, | 48 | .proc_handler = proc_dointvec, |
52 | }, | 49 | }, |
53 | { .ctl_name = 0 } | 50 | { } |
54 | }; | 51 | }; |
55 | 52 | ||
56 | /* dir in /proc/sys/dev */ | 53 | /* dir in /proc/sys/dev */ |
57 | static ctl_table mac_hid_dir[] = { | 54 | static ctl_table mac_hid_dir[] = { |
58 | { | 55 | { |
59 | .ctl_name = DEV_MAC_HID, | ||
60 | .procname = "mac_hid", | 56 | .procname = "mac_hid", |
61 | .maxlen = 0, | 57 | .maxlen = 0, |
62 | .mode = 0555, | 58 | .mode = 0555, |
63 | .child = mac_hid_files, | 59 | .child = mac_hid_files, |
64 | }, | 60 | }, |
65 | { .ctl_name = 0 } | 61 | { } |
66 | }; | 62 | }; |
67 | 63 | ||
68 | /* /proc/sys/dev itself, in case that is not there yet */ | 64 | /* /proc/sys/dev itself, in case that is not there yet */ |
69 | static ctl_table mac_hid_root_dir[] = { | 65 | static ctl_table mac_hid_root_dir[] = { |
70 | { | 66 | { |
71 | .ctl_name = CTL_DEV, | ||
72 | .procname = "dev", | 67 | .procname = "dev", |
73 | .maxlen = 0, | 68 | .maxlen = 0, |
74 | .mode = 0555, | 69 | .mode = 0555, |
75 | .child = mac_hid_dir, | 70 | .child = mac_hid_dir, |
76 | }, | 71 | }, |
77 | { .ctl_name = 0 } | 72 | { } |
78 | }; | 73 | }; |
79 | 74 | ||
80 | static struct ctl_table_header *mac_hid_sysctl_header; | 75 | static struct ctl_table_header *mac_hid_sysctl_header; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index b182f86a19dd..5f154ef1e4be 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -98,44 +98,40 @@ static struct ctl_table_header *raid_table_header; | |||
98 | 98 | ||
99 | static ctl_table raid_table[] = { | 99 | static ctl_table raid_table[] = { |
100 | { | 100 | { |
101 | .ctl_name = DEV_RAID_SPEED_LIMIT_MIN, | ||
102 | .procname = "speed_limit_min", | 101 | .procname = "speed_limit_min", |
103 | .data = &sysctl_speed_limit_min, | 102 | .data = &sysctl_speed_limit_min, |
104 | .maxlen = sizeof(int), | 103 | .maxlen = sizeof(int), |
105 | .mode = S_IRUGO|S_IWUSR, | 104 | .mode = S_IRUGO|S_IWUSR, |
106 | .proc_handler = &proc_dointvec, | 105 | .proc_handler = proc_dointvec, |
107 | }, | 106 | }, |
108 | { | 107 | { |
109 | .ctl_name = DEV_RAID_SPEED_LIMIT_MAX, | ||
110 | .procname = "speed_limit_max", | 108 | .procname = "speed_limit_max", |
111 | .data = &sysctl_speed_limit_max, | 109 | .data = &sysctl_speed_limit_max, |
112 | .maxlen = sizeof(int), | 110 | .maxlen = sizeof(int), |
113 | .mode = S_IRUGO|S_IWUSR, | 111 | .mode = S_IRUGO|S_IWUSR, |
114 | .proc_handler = &proc_dointvec, | 112 | .proc_handler = proc_dointvec, |
115 | }, | 113 | }, |
116 | { .ctl_name = 0 } | 114 | { } |
117 | }; | 115 | }; |
118 | 116 | ||
119 | static ctl_table raid_dir_table[] = { | 117 | static ctl_table raid_dir_table[] = { |
120 | { | 118 | { |
121 | .ctl_name = DEV_RAID, | ||
122 | .procname = "raid", | 119 | .procname = "raid", |
123 | .maxlen = 0, | 120 | .maxlen = 0, |
124 | .mode = S_IRUGO|S_IXUGO, | 121 | .mode = S_IRUGO|S_IXUGO, |
125 | .child = raid_table, | 122 | .child = raid_table, |
126 | }, | 123 | }, |
127 | { .ctl_name = 0 } | 124 | { } |
128 | }; | 125 | }; |
129 | 126 | ||
130 | static ctl_table raid_root_table[] = { | 127 | static ctl_table raid_root_table[] = { |
131 | { | 128 | { |
132 | .ctl_name = CTL_DEV, | ||
133 | .procname = "dev", | 129 | .procname = "dev", |
134 | .maxlen = 0, | 130 | .maxlen = 0, |
135 | .mode = 0555, | 131 | .mode = 0555, |
136 | .child = raid_dir_table, | 132 | .child = raid_dir_table, |
137 | }, | 133 | }, |
138 | { .ctl_name = 0 } | 134 | { } |
139 | }; | 135 | }; |
140 | 136 | ||
141 | static const struct block_device_operations md_fops; | 137 | static const struct block_device_operations md_fops; |
diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c index fd3688a3e23f..832ed4c88cf7 100644 --- a/drivers/misc/sgi-xp/xpc_main.c +++ b/drivers/misc/sgi-xp/xpc_main.c | |||
@@ -89,48 +89,40 @@ static int xpc_disengage_max_timelimit = 120; | |||
89 | 89 | ||
90 | static ctl_table xpc_sys_xpc_hb_dir[] = { | 90 | static ctl_table xpc_sys_xpc_hb_dir[] = { |
91 | { | 91 | { |
92 | .ctl_name = CTL_UNNUMBERED, | ||
93 | .procname = "hb_interval", | 92 | .procname = "hb_interval", |
94 | .data = &xpc_hb_interval, | 93 | .data = &xpc_hb_interval, |
95 | .maxlen = sizeof(int), | 94 | .maxlen = sizeof(int), |
96 | .mode = 0644, | 95 | .mode = 0644, |
97 | .proc_handler = &proc_dointvec_minmax, | 96 | .proc_handler = proc_dointvec_minmax, |
98 | .strategy = &sysctl_intvec, | ||
99 | .extra1 = &xpc_hb_min_interval, | 97 | .extra1 = &xpc_hb_min_interval, |
100 | .extra2 = &xpc_hb_max_interval}, | 98 | .extra2 = &xpc_hb_max_interval}, |
101 | { | 99 | { |
102 | .ctl_name = CTL_UNNUMBERED, | ||
103 | .procname = "hb_check_interval", | 100 | .procname = "hb_check_interval", |
104 | .data = &xpc_hb_check_interval, | 101 | .data = &xpc_hb_check_interval, |
105 | .maxlen = sizeof(int), | 102 | .maxlen = sizeof(int), |
106 | .mode = 0644, | 103 | .mode = 0644, |
107 | .proc_handler = &proc_dointvec_minmax, | 104 | .proc_handler = proc_dointvec_minmax, |
108 | .strategy = &sysctl_intvec, | ||
109 | .extra1 = &xpc_hb_check_min_interval, | 105 | .extra1 = &xpc_hb_check_min_interval, |
110 | .extra2 = &xpc_hb_check_max_interval}, | 106 | .extra2 = &xpc_hb_check_max_interval}, |
111 | {} | 107 | {} |
112 | }; | 108 | }; |
113 | static ctl_table xpc_sys_xpc_dir[] = { | 109 | static ctl_table xpc_sys_xpc_dir[] = { |
114 | { | 110 | { |
115 | .ctl_name = CTL_UNNUMBERED, | ||
116 | .procname = "hb", | 111 | .procname = "hb", |
117 | .mode = 0555, | 112 | .mode = 0555, |
118 | .child = xpc_sys_xpc_hb_dir}, | 113 | .child = xpc_sys_xpc_hb_dir}, |
119 | { | 114 | { |
120 | .ctl_name = CTL_UNNUMBERED, | ||
121 | .procname = "disengage_timelimit", | 115 | .procname = "disengage_timelimit", |
122 | .data = &xpc_disengage_timelimit, | 116 | .data = &xpc_disengage_timelimit, |
123 | .maxlen = sizeof(int), | 117 | .maxlen = sizeof(int), |
124 | .mode = 0644, | 118 | .mode = 0644, |
125 | .proc_handler = &proc_dointvec_minmax, | 119 | .proc_handler = proc_dointvec_minmax, |
126 | .strategy = &sysctl_intvec, | ||
127 | .extra1 = &xpc_disengage_min_timelimit, | 120 | .extra1 = &xpc_disengage_min_timelimit, |
128 | .extra2 = &xpc_disengage_max_timelimit}, | 121 | .extra2 = &xpc_disengage_max_timelimit}, |
129 | {} | 122 | {} |
130 | }; | 123 | }; |
131 | static ctl_table xpc_sys_dir[] = { | 124 | static ctl_table xpc_sys_dir[] = { |
132 | { | 125 | { |
133 | .ctl_name = CTL_UNNUMBERED, | ||
134 | .procname = "xpc", | 126 | .procname = "xpc", |
135 | .mode = 0555, | 127 | .mode = 0555, |
136 | .child = xpc_sys_xpc_dir}, | 128 | .child = xpc_sys_xpc_dir}, |
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c index a8b689635a3b..b22983e6c0cf 100644 --- a/drivers/net/wireless/arlan-proc.c +++ b/drivers/net/wireless/arlan-proc.c | |||
@@ -816,84 +816,83 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, | |||
816 | 816 | ||
817 | 817 | ||
818 | /* Place files in /proc/sys/dev/arlan */ | 818 | /* Place files in /proc/sys/dev/arlan */ |
819 | #define CTBLN(num,card,nam) \ | 819 | #define CTBLN(card,nam) \ |
820 | { .ctl_name = num,\ | 820 | { .procname = #nam,\ |
821 | .procname = #nam,\ | ||
822 | .data = &(arlan_conf[card].nam),\ | 821 | .data = &(arlan_conf[card].nam),\ |
823 | .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec} | 822 | .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec} |
824 | #ifdef ARLAN_DEBUGGING | 823 | #ifdef ARLAN_DEBUGGING |
825 | 824 | ||
826 | #define ARLAN_PROC_DEBUG_ENTRIES \ | 825 | #define ARLAN_PROC_DEBUG_ENTRIES \ |
827 | { .ctl_name = 48, .procname = "entry_exit_debug",\ | 826 | { .procname = "entry_exit_debug",\ |
828 | .data = &arlan_entry_and_exit_debug,\ | 827 | .data = &arlan_entry_and_exit_debug,\ |
829 | .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\ | 828 | .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec},\ |
830 | { .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\ | 829 | { .procname = "debug", .data = &arlan_debug,\ |
831 | .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}, | 830 | .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec}, |
832 | #else | 831 | #else |
833 | #define ARLAN_PROC_DEBUG_ENTRIES | 832 | #define ARLAN_PROC_DEBUG_ENTRIES |
834 | #endif | 833 | #endif |
835 | 834 | ||
836 | #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\ | 835 | #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\ |
837 | CTBLN(1,cardNo,spreadingCode),\ | 836 | CTBLN(cardNo,spreadingCode),\ |
838 | CTBLN(2,cardNo, channelNumber),\ | 837 | CTBLN(cardNo, channelNumber),\ |
839 | CTBLN(3,cardNo, scramblingDisable),\ | 838 | CTBLN(cardNo, scramblingDisable),\ |
840 | CTBLN(4,cardNo, txAttenuation),\ | 839 | CTBLN(cardNo, txAttenuation),\ |
841 | CTBLN(5,cardNo, systemId), \ | 840 | CTBLN(cardNo, systemId), \ |
842 | CTBLN(6,cardNo, maxDatagramSize),\ | 841 | CTBLN(cardNo, maxDatagramSize),\ |
843 | CTBLN(7,cardNo, maxFrameSize),\ | 842 | CTBLN(cardNo, maxFrameSize),\ |
844 | CTBLN(8,cardNo, maxRetries),\ | 843 | CTBLN(cardNo, maxRetries),\ |
845 | CTBLN(9,cardNo, receiveMode),\ | 844 | CTBLN(cardNo, receiveMode),\ |
846 | CTBLN(10,cardNo, priority),\ | 845 | CTBLN(cardNo, priority),\ |
847 | CTBLN(11,cardNo, rootOrRepeater),\ | 846 | CTBLN(cardNo, rootOrRepeater),\ |
848 | CTBLN(12,cardNo, SID),\ | 847 | CTBLN(cardNo, SID),\ |
849 | CTBLN(13,cardNo, registrationMode),\ | 848 | CTBLN(cardNo, registrationMode),\ |
850 | CTBLN(14,cardNo, registrationFill),\ | 849 | CTBLN(cardNo, registrationFill),\ |
851 | CTBLN(15,cardNo, localTalkAddress),\ | 850 | CTBLN(cardNo, localTalkAddress),\ |
852 | CTBLN(16,cardNo, codeFormat),\ | 851 | CTBLN(cardNo, codeFormat),\ |
853 | CTBLN(17,cardNo, numChannels),\ | 852 | CTBLN(cardNo, numChannels),\ |
854 | CTBLN(18,cardNo, channel1),\ | 853 | CTBLN(cardNo, channel1),\ |
855 | CTBLN(19,cardNo, channel2),\ | 854 | CTBLN(cardNo, channel2),\ |
856 | CTBLN(20,cardNo, channel3),\ | 855 | CTBLN(cardNo, channel3),\ |
857 | CTBLN(21,cardNo, channel4),\ | 856 | CTBLN(cardNo, channel4),\ |
858 | CTBLN(22,cardNo, txClear),\ | 857 | CTBLN(cardNo, txClear),\ |
859 | CTBLN(23,cardNo, txRetries),\ | 858 | CTBLN(cardNo, txRetries),\ |
860 | CTBLN(24,cardNo, txRouting),\ | 859 | CTBLN(cardNo, txRouting),\ |
861 | CTBLN(25,cardNo, txScrambled),\ | 860 | CTBLN(cardNo, txScrambled),\ |
862 | CTBLN(26,cardNo, rxParameter),\ | 861 | CTBLN(cardNo, rxParameter),\ |
863 | CTBLN(27,cardNo, txTimeoutMs),\ | 862 | CTBLN(cardNo, txTimeoutMs),\ |
864 | CTBLN(28,cardNo, waitCardTimeout),\ | 863 | CTBLN(cardNo, waitCardTimeout),\ |
865 | CTBLN(29,cardNo, channelSet), \ | 864 | CTBLN(cardNo, channelSet), \ |
866 | {.ctl_name = 30, .procname = "name",\ | 865 | { .procname = "name",\ |
867 | .data = arlan_conf[cardNo].siteName,\ | 866 | .data = arlan_conf[cardNo].siteName,\ |
868 | .maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\ | 867 | .maxlen = 16, .mode = 0600, .proc_handler = proc_dostring},\ |
869 | CTBLN(31,cardNo,waitTime),\ | 868 | CTBLN(cardNo,waitTime),\ |
870 | CTBLN(32,cardNo,lParameter),\ | 869 | CTBLN(cardNo,lParameter),\ |
871 | CTBLN(33,cardNo,_15),\ | 870 | CTBLN(cardNo,_15),\ |
872 | CTBLN(34,cardNo,headerSize),\ | 871 | CTBLN(cardNo,headerSize),\ |
873 | CTBLN(36,cardNo,tx_delay_ms),\ | 872 | CTBLN(cardNo,tx_delay_ms),\ |
874 | CTBLN(37,cardNo,retries),\ | 873 | CTBLN(cardNo,retries),\ |
875 | CTBLN(38,cardNo,ReTransmitPacketMaxSize),\ | 874 | CTBLN(cardNo,ReTransmitPacketMaxSize),\ |
876 | CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\ | 875 | CTBLN(cardNo,waitReTransmitPacketMaxSize),\ |
877 | CTBLN(40,cardNo,fastReTransCount),\ | 876 | CTBLN(cardNo,fastReTransCount),\ |
878 | CTBLN(41,cardNo,driverRetransmissions),\ | 877 | CTBLN(cardNo,driverRetransmissions),\ |
879 | CTBLN(42,cardNo,txAckTimeoutMs),\ | 878 | CTBLN(cardNo,txAckTimeoutMs),\ |
880 | CTBLN(43,cardNo,registrationInterrupts),\ | 879 | CTBLN(cardNo,registrationInterrupts),\ |
881 | CTBLN(44,cardNo,hardwareType),\ | 880 | CTBLN(cardNo,hardwareType),\ |
882 | CTBLN(45,cardNo,radioType),\ | 881 | CTBLN(cardNo,radioType),\ |
883 | CTBLN(46,cardNo,writeEEPROM),\ | 882 | CTBLN(cardNo,writeEEPROM),\ |
884 | CTBLN(47,cardNo,writeRadioType),\ | 883 | CTBLN(cardNo,writeRadioType),\ |
885 | ARLAN_PROC_DEBUG_ENTRIES\ | 884 | ARLAN_PROC_DEBUG_ENTRIES\ |
886 | CTBLN(50,cardNo,in_speed),\ | 885 | CTBLN(cardNo,in_speed),\ |
887 | CTBLN(51,cardNo,out_speed),\ | 886 | CTBLN(cardNo,out_speed),\ |
888 | CTBLN(52,cardNo,in_speed10),\ | 887 | CTBLN(cardNo,in_speed10),\ |
889 | CTBLN(53,cardNo,out_speed10),\ | 888 | CTBLN(cardNo,out_speed10),\ |
890 | CTBLN(54,cardNo,in_speed_max),\ | 889 | CTBLN(cardNo,in_speed_max),\ |
891 | CTBLN(55,cardNo,out_speed_max),\ | 890 | CTBLN(cardNo,out_speed_max),\ |
892 | CTBLN(56,cardNo,measure_rate),\ | 891 | CTBLN(cardNo,measure_rate),\ |
893 | CTBLN(57,cardNo,pre_Command_Wait),\ | 892 | CTBLN(cardNo,pre_Command_Wait),\ |
894 | CTBLN(58,cardNo,rx_tweak1),\ | 893 | CTBLN(cardNo,rx_tweak1),\ |
895 | CTBLN(59,cardNo,rx_tweak2),\ | 894 | CTBLN(cardNo,rx_tweak2),\ |
896 | CTBLN(60,cardNo,tx_queue_len),\ | 895 | CTBLN(cardNo,tx_queue_len),\ |
897 | 896 | ||
898 | 897 | ||
899 | 898 | ||
@@ -903,63 +902,56 @@ static ctl_table arlan_conf_table0[] = | |||
903 | 902 | ||
904 | #ifdef ARLAN_PROC_SHM_DUMP | 903 | #ifdef ARLAN_PROC_SHM_DUMP |
905 | { | 904 | { |
906 | .ctl_name = 150, | ||
907 | .procname = "arlan0-txRing", | 905 | .procname = "arlan0-txRing", |
908 | .data = &arlan_drive_info, | 906 | .data = &arlan_drive_info, |
909 | .maxlen = ARLAN_STR_SIZE, | 907 | .maxlen = ARLAN_STR_SIZE, |
910 | .mode = 0400, | 908 | .mode = 0400, |
911 | .proc_handler = &arlan_sysctl_infotxRing, | 909 | .proc_handler = arlan_sysctl_infotxRing, |
912 | }, | 910 | }, |
913 | { | 911 | { |
914 | .ctl_name = 151, | ||
915 | .procname = "arlan0-rxRing", | 912 | .procname = "arlan0-rxRing", |
916 | .data = &arlan_drive_info, | 913 | .data = &arlan_drive_info, |
917 | .maxlen = ARLAN_STR_SIZE, | 914 | .maxlen = ARLAN_STR_SIZE, |
918 | .mode = 0400, | 915 | .mode = 0400, |
919 | .proc_handler = &arlan_sysctl_inforxRing, | 916 | .proc_handler = arlan_sysctl_inforxRing, |
920 | }, | 917 | }, |
921 | { | 918 | { |
922 | .ctl_name = 152, | ||
923 | .procname = "arlan0-18", | 919 | .procname = "arlan0-18", |
924 | .data = &arlan_drive_info, | 920 | .data = &arlan_drive_info, |
925 | .maxlen = ARLAN_STR_SIZE, | 921 | .maxlen = ARLAN_STR_SIZE, |
926 | .mode = 0400, | 922 | .mode = 0400, |
927 | .proc_handler = &arlan_sysctl_info18, | 923 | .proc_handler = arlan_sysctl_info18, |
928 | }, | 924 | }, |
929 | { | 925 | { |
930 | .ctl_name = 153, | ||
931 | .procname = "arlan0-ring", | 926 | .procname = "arlan0-ring", |
932 | .data = &arlan_drive_info, | 927 | .data = &arlan_drive_info, |
933 | .maxlen = ARLAN_STR_SIZE, | 928 | .maxlen = ARLAN_STR_SIZE, |
934 | .mode = 0400, | 929 | .mode = 0400, |
935 | .proc_handler = &arlan_sysctl_info161719, | 930 | .proc_handler = arlan_sysctl_info161719, |
936 | }, | 931 | }, |
937 | { | 932 | { |
938 | .ctl_name = 154, | ||
939 | .procname = "arlan0-shm-cpy", | 933 | .procname = "arlan0-shm-cpy", |
940 | .data = &arlan_drive_info, | 934 | .data = &arlan_drive_info, |
941 | .maxlen = ARLAN_STR_SIZE, | 935 | .maxlen = ARLAN_STR_SIZE, |
942 | .mode = 0400, | 936 | .mode = 0400, |
943 | .proc_handler = &arlan_sysctl_info, | 937 | .proc_handler = arlan_sysctl_info, |
944 | }, | 938 | }, |
945 | #endif | 939 | #endif |
946 | { | 940 | { |
947 | .ctl_name = 155, | ||
948 | .procname = "config0", | 941 | .procname = "config0", |
949 | .data = &conf_reset_result, | 942 | .data = &conf_reset_result, |
950 | .maxlen = 100, | 943 | .maxlen = 100, |
951 | .mode = 0400, | 944 | .mode = 0400, |
952 | .proc_handler = &arlan_configure | 945 | .proc_handler = arlan_configure |
953 | }, | 946 | }, |
954 | { | 947 | { |
955 | .ctl_name = 156, | ||
956 | .procname = "reset0", | 948 | .procname = "reset0", |
957 | .data = &conf_reset_result, | 949 | .data = &conf_reset_result, |
958 | .maxlen = 100, | 950 | .maxlen = 100, |
959 | .mode = 0400, | 951 | .mode = 0400, |
960 | .proc_handler = &arlan_sysctl_reset, | 952 | .proc_handler = arlan_sysctl_reset, |
961 | }, | 953 | }, |
962 | { .ctl_name = 0 } | 954 | { } |
963 | }; | 955 | }; |
964 | 956 | ||
965 | static ctl_table arlan_conf_table1[] = | 957 | static ctl_table arlan_conf_table1[] = |
@@ -969,63 +961,56 @@ static ctl_table arlan_conf_table1[] = | |||
969 | 961 | ||
970 | #ifdef ARLAN_PROC_SHM_DUMP | 962 | #ifdef ARLAN_PROC_SHM_DUMP |
971 | { | 963 | { |
972 | .ctl_name = 150, | ||
973 | .procname = "arlan1-txRing", | 964 | .procname = "arlan1-txRing", |
974 | .data = &arlan_drive_info, | 965 | .data = &arlan_drive_info, |
975 | .maxlen = ARLAN_STR_SIZE, | 966 | .maxlen = ARLAN_STR_SIZE, |
976 | .mode = 0400, | 967 | .mode = 0400, |
977 | .proc_handler = &arlan_sysctl_infotxRing, | 968 | .proc_handler = arlan_sysctl_infotxRing, |
978 | }, | 969 | }, |
979 | { | 970 | { |
980 | .ctl_name = 151, | ||
981 | .procname = "arlan1-rxRing", | 971 | .procname = "arlan1-rxRing", |
982 | .data = &arlan_drive_info, | 972 | .data = &arlan_drive_info, |
983 | .maxlen = ARLAN_STR_SIZE, | 973 | .maxlen = ARLAN_STR_SIZE, |
984 | .mode = 0400, | 974 | .mode = 0400, |
985 | .proc_handler = &arlan_sysctl_inforxRing, | 975 | .proc_handler = arlan_sysctl_inforxRing, |
986 | }, | 976 | }, |
987 | { | 977 | { |
988 | .ctl_name = 152, | ||
989 | .procname = "arlan1-18", | 978 | .procname = "arlan1-18", |
990 | .data = &arlan_drive_info, | 979 | .data = &arlan_drive_info, |
991 | .maxlen = ARLAN_STR_SIZE, | 980 | .maxlen = ARLAN_STR_SIZE, |
992 | .mode = 0400, | 981 | .mode = 0400, |
993 | .proc_handler = &arlan_sysctl_info18, | 982 | .proc_handler = arlan_sysctl_info18, |
994 | }, | 983 | }, |
995 | { | 984 | { |
996 | .ctl_name = 153, | ||
997 | .procname = "arlan1-ring", | 985 | .procname = "arlan1-ring", |
998 | .data = &arlan_drive_info, | 986 | .data = &arlan_drive_info, |
999 | .maxlen = ARLAN_STR_SIZE, | 987 | .maxlen = ARLAN_STR_SIZE, |
1000 | .mode = 0400, | 988 | .mode = 0400, |
1001 | .proc_handler = &arlan_sysctl_info161719, | 989 | .proc_handler = arlan_sysctl_info161719, |
1002 | }, | 990 | }, |
1003 | { | 991 | { |
1004 | .ctl_name = 154, | ||
1005 | .procname = "arlan1-shm-cpy", | 992 | .procname = "arlan1-shm-cpy", |
1006 | .data = &arlan_drive_info, | 993 | .data = &arlan_drive_info, |
1007 | .maxlen = ARLAN_STR_SIZE, | 994 | .maxlen = ARLAN_STR_SIZE, |
1008 | .mode = 0400, | 995 | .mode = 0400, |
1009 | .proc_handler = &arlan_sysctl_info, | 996 | .proc_handler = arlan_sysctl_info, |
1010 | }, | 997 | }, |
1011 | #endif | 998 | #endif |
1012 | { | 999 | { |
1013 | .ctl_name = 155, | ||
1014 | .procname = "config1", | 1000 | .procname = "config1", |
1015 | .data = &conf_reset_result, | 1001 | .data = &conf_reset_result, |
1016 | .maxlen = 100, | 1002 | .maxlen = 100, |
1017 | .mode = 0400, | 1003 | .mode = 0400, |
1018 | .proc_handler = &arlan_configure, | 1004 | .proc_handler = arlan_configure, |
1019 | }, | 1005 | }, |
1020 | { | 1006 | { |
1021 | .ctl_name = 156, | ||
1022 | .procname = "reset1", | 1007 | .procname = "reset1", |
1023 | .data = &conf_reset_result, | 1008 | .data = &conf_reset_result, |
1024 | .maxlen = 100, | 1009 | .maxlen = 100, |
1025 | .mode = 0400, | 1010 | .mode = 0400, |
1026 | .proc_handler = &arlan_sysctl_reset, | 1011 | .proc_handler = arlan_sysctl_reset, |
1027 | }, | 1012 | }, |
1028 | { .ctl_name = 0 } | 1013 | { } |
1029 | }; | 1014 | }; |
1030 | 1015 | ||
1031 | static ctl_table arlan_conf_table2[] = | 1016 | static ctl_table arlan_conf_table2[] = |
@@ -1035,63 +1020,56 @@ static ctl_table arlan_conf_table2[] = | |||
1035 | 1020 | ||
1036 | #ifdef ARLAN_PROC_SHM_DUMP | 1021 | #ifdef ARLAN_PROC_SHM_DUMP |
1037 | { | 1022 | { |
1038 | .ctl_name = 150, | ||
1039 | .procname = "arlan2-txRing", | 1023 | .procname = "arlan2-txRing", |
1040 | .data = &arlan_drive_info, | 1024 | .data = &arlan_drive_info, |
1041 | .maxlen = ARLAN_STR_SIZE, | 1025 | .maxlen = ARLAN_STR_SIZE, |
1042 | .mode = 0400, | 1026 | .mode = 0400, |
1043 | .proc_handler = &arlan_sysctl_infotxRing, | 1027 | .proc_handler = arlan_sysctl_infotxRing, |
1044 | }, | 1028 | }, |
1045 | { | 1029 | { |
1046 | .ctl_name = 151, | ||
1047 | .procname = "arlan2-rxRing", | 1030 | .procname = "arlan2-rxRing", |
1048 | .data = &arlan_drive_info, | 1031 | .data = &arlan_drive_info, |
1049 | .maxlen = ARLAN_STR_SIZE, | 1032 | .maxlen = ARLAN_STR_SIZE, |
1050 | .mode = 0400, | 1033 | .mode = 0400, |
1051 | .proc_handler = &arlan_sysctl_inforxRing, | 1034 | .proc_handler = arlan_sysctl_inforxRing, |
1052 | }, | 1035 | }, |
1053 | { | 1036 | { |
1054 | .ctl_name = 152, | ||
1055 | .procname = "arlan2-18", | 1037 | .procname = "arlan2-18", |
1056 | .data = &arlan_drive_info, | 1038 | .data = &arlan_drive_info, |
1057 | .maxlen = ARLAN_STR_SIZE, | 1039 | .maxlen = ARLAN_STR_SIZE, |
1058 | .mode = 0400, | 1040 | .mode = 0400, |
1059 | .proc_handler = &arlan_sysctl_info18, | 1041 | .proc_handler = arlan_sysctl_info18, |
1060 | }, | 1042 | }, |
1061 | { | 1043 | { |
1062 | .ctl_name = 153, | ||
1063 | .procname = "arlan2-ring", | 1044 | .procname = "arlan2-ring", |
1064 | .data = &arlan_drive_info, | 1045 | .data = &arlan_drive_info, |
1065 | .maxlen = ARLAN_STR_SIZE, | 1046 | .maxlen = ARLAN_STR_SIZE, |
1066 | .mode = 0400, | 1047 | .mode = 0400, |
1067 | .proc_handler = &arlan_sysctl_info161719, | 1048 | .proc_handler = arlan_sysctl_info161719, |
1068 | }, | 1049 | }, |
1069 | { | 1050 | { |
1070 | .ctl_name = 154, | ||
1071 | .procname = "arlan2-shm-cpy", | 1051 | .procname = "arlan2-shm-cpy", |
1072 | .data = &arlan_drive_info, | 1052 | .data = &arlan_drive_info, |
1073 | .maxlen = ARLAN_STR_SIZE, | 1053 | .maxlen = ARLAN_STR_SIZE, |
1074 | .mode = 0400, | 1054 | .mode = 0400, |
1075 | .proc_handler = &arlan_sysctl_info, | 1055 | .proc_handler = arlan_sysctl_info, |
1076 | }, | 1056 | }, |
1077 | #endif | 1057 | #endif |
1078 | { | 1058 | { |
1079 | .ctl_name = 155, | ||
1080 | .procname = "config2", | 1059 | .procname = "config2", |
1081 | .data = &conf_reset_result, | 1060 | .data = &conf_reset_result, |
1082 | .maxlen = 100, | 1061 | .maxlen = 100, |
1083 | .mode = 0400, | 1062 | .mode = 0400, |
1084 | .proc_handler = &arlan_configure, | 1063 | .proc_handler = arlan_configure, |
1085 | }, | 1064 | }, |
1086 | { | 1065 | { |
1087 | .ctl_name = 156, | ||
1088 | .procname = "reset2", | 1066 | .procname = "reset2", |
1089 | .data = &conf_reset_result, | 1067 | .data = &conf_reset_result, |
1090 | .maxlen = 100, | 1068 | .maxlen = 100, |
1091 | .mode = 0400, | 1069 | .mode = 0400, |
1092 | .proc_handler = &arlan_sysctl_reset, | 1070 | .proc_handler = arlan_sysctl_reset, |
1093 | }, | 1071 | }, |
1094 | { .ctl_name = 0 } | 1072 | { } |
1095 | }; | 1073 | }; |
1096 | 1074 | ||
1097 | static ctl_table arlan_conf_table3[] = | 1075 | static ctl_table arlan_conf_table3[] = |
@@ -1101,63 +1079,56 @@ static ctl_table arlan_conf_table3[] = | |||
1101 | 1079 | ||
1102 | #ifdef ARLAN_PROC_SHM_DUMP | 1080 | #ifdef ARLAN_PROC_SHM_DUMP |
1103 | { | 1081 | { |
1104 | .ctl_name = 150, | ||
1105 | .procname = "arlan3-txRing", | 1082 | .procname = "arlan3-txRing", |
1106 | .data = &arlan_drive_info, | 1083 | .data = &arlan_drive_info, |
1107 | .maxlen = ARLAN_STR_SIZE, | 1084 | .maxlen = ARLAN_STR_SIZE, |
1108 | .mode = 0400, | 1085 | .mode = 0400, |
1109 | .proc_handler = &arlan_sysctl_infotxRing, | 1086 | .proc_handler = arlan_sysctl_infotxRing, |
1110 | }, | 1087 | }, |
1111 | { | 1088 | { |
1112 | .ctl_name = 151, | ||
1113 | .procname = "arlan3-rxRing", | 1089 | .procname = "arlan3-rxRing", |
1114 | .data = &arlan_drive_info, | 1090 | .data = &arlan_drive_info, |
1115 | .maxlen = ARLAN_STR_SIZE, | 1091 | .maxlen = ARLAN_STR_SIZE, |
1116 | .mode = 0400, | 1092 | .mode = 0400, |
1117 | .proc_handler = &arlan_sysctl_inforxRing, | 1093 | .proc_handler = arlan_sysctl_inforxRing, |
1118 | }, | 1094 | }, |
1119 | { | 1095 | { |
1120 | .ctl_name = 152, | ||
1121 | .procname = "arlan3-18", | 1096 | .procname = "arlan3-18", |
1122 | .data = &arlan_drive_info, | 1097 | .data = &arlan_drive_info, |
1123 | .maxlen = ARLAN_STR_SIZE, | 1098 | .maxlen = ARLAN_STR_SIZE, |
1124 | .mode = 0400, | 1099 | .mode = 0400, |
1125 | .proc_handler = &arlan_sysctl_info18, | 1100 | .proc_handler = arlan_sysctl_info18, |
1126 | }, | 1101 | }, |
1127 | { | 1102 | { |
1128 | .ctl_name = 153, | ||
1129 | .procname = "arlan3-ring", | 1103 | .procname = "arlan3-ring", |
1130 | .data = &arlan_drive_info, | 1104 | .data = &arlan_drive_info, |
1131 | .maxlen = ARLAN_STR_SIZE, | 1105 | .maxlen = ARLAN_STR_SIZE, |
1132 | .mode = 0400, | 1106 | .mode = 0400, |
1133 | .proc_handler = &arlan_sysctl_info161719, | 1107 | .proc_handler = arlan_sysctl_info161719, |
1134 | }, | 1108 | }, |
1135 | { | 1109 | { |
1136 | .ctl_name = 154, | ||
1137 | .procname = "arlan3-shm-cpy", | 1110 | .procname = "arlan3-shm-cpy", |
1138 | .data = &arlan_drive_info, | 1111 | .data = &arlan_drive_info, |
1139 | .maxlen = ARLAN_STR_SIZE, | 1112 | .maxlen = ARLAN_STR_SIZE, |
1140 | .mode = 0400, | 1113 | .mode = 0400, |
1141 | .proc_handler = &arlan_sysctl_info, | 1114 | .proc_handler = arlan_sysctl_info, |
1142 | }, | 1115 | }, |
1143 | #endif | 1116 | #endif |
1144 | { | 1117 | { |
1145 | .ctl_name = 155, | ||
1146 | .procname = "config3", | 1118 | .procname = "config3", |
1147 | .data = &conf_reset_result, | 1119 | .data = &conf_reset_result, |
1148 | .maxlen = 100, | 1120 | .maxlen = 100, |
1149 | .mode = 0400, | 1121 | .mode = 0400, |
1150 | .proc_handler = &arlan_configure, | 1122 | .proc_handler = arlan_configure, |
1151 | }, | 1123 | }, |
1152 | { | 1124 | { |
1153 | .ctl_name = 156, | ||
1154 | .procname = "reset3", | 1125 | .procname = "reset3", |
1155 | .data = &conf_reset_result, | 1126 | .data = &conf_reset_result, |
1156 | .maxlen = 100, | 1127 | .maxlen = 100, |
1157 | .mode = 0400, | 1128 | .mode = 0400, |
1158 | .proc_handler = &arlan_sysctl_reset, | 1129 | .proc_handler = arlan_sysctl_reset, |
1159 | }, | 1130 | }, |
1160 | { .ctl_name = 0 } | 1131 | { } |
1161 | }; | 1132 | }; |
1162 | 1133 | ||
1163 | 1134 | ||
@@ -1165,41 +1136,37 @@ static ctl_table arlan_conf_table3[] = | |||
1165 | static ctl_table arlan_table[] = | 1136 | static ctl_table arlan_table[] = |
1166 | { | 1137 | { |
1167 | { | 1138 | { |
1168 | .ctl_name = 0, | ||
1169 | .procname = "arlan0", | 1139 | .procname = "arlan0", |
1170 | .maxlen = 0, | 1140 | .maxlen = 0, |
1171 | .mode = 0600, | 1141 | .mode = 0600, |
1172 | .child = arlan_conf_table0, | 1142 | .child = arlan_conf_table0, |
1173 | }, | 1143 | }, |
1174 | { | 1144 | { |
1175 | .ctl_name = 0, | ||
1176 | .procname = "arlan1", | 1145 | .procname = "arlan1", |
1177 | .maxlen = 0, | 1146 | .maxlen = 0, |
1178 | .mode = 0600, | 1147 | .mode = 0600, |
1179 | .child = arlan_conf_table1, | 1148 | .child = arlan_conf_table1, |
1180 | }, | 1149 | }, |
1181 | { | 1150 | { |
1182 | .ctl_name = 0, | ||
1183 | .procname = "arlan2", | 1151 | .procname = "arlan2", |
1184 | .maxlen = 0, | 1152 | .maxlen = 0, |
1185 | .mode = 0600, | 1153 | .mode = 0600, |
1186 | .child = arlan_conf_table2, | 1154 | .child = arlan_conf_table2, |
1187 | }, | 1155 | }, |
1188 | { | 1156 | { |
1189 | .ctl_name = 0, | ||
1190 | .procname = "arlan3", | 1157 | .procname = "arlan3", |
1191 | .maxlen = 0, | 1158 | .maxlen = 0, |
1192 | .mode = 0600, | 1159 | .mode = 0600, |
1193 | .child = arlan_conf_table3, | 1160 | .child = arlan_conf_table3, |
1194 | }, | 1161 | }, |
1195 | { .ctl_name = 0 } | 1162 | { } |
1196 | }; | 1163 | }; |
1197 | 1164 | ||
1198 | #else | 1165 | #else |
1199 | 1166 | ||
1200 | static ctl_table arlan_table[MAX_ARLANS + 1] = | 1167 | static ctl_table arlan_table[] = |
1201 | { | 1168 | { |
1202 | { .ctl_name = 0 } | 1169 | { } |
1203 | }; | 1170 | }; |
1204 | #endif | 1171 | #endif |
1205 | 1172 | ||
@@ -1209,22 +1176,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] = | |||
1209 | static ctl_table arlan_root_table[] = | 1176 | static ctl_table arlan_root_table[] = |
1210 | { | 1177 | { |
1211 | { | 1178 | { |
1212 | .ctl_name = CTL_ARLAN, | ||
1213 | .procname = "arlan", | 1179 | .procname = "arlan", |
1214 | .maxlen = 0, | 1180 | .maxlen = 0, |
1215 | .mode = 0555, | 1181 | .mode = 0555, |
1216 | .child = arlan_table, | 1182 | .child = arlan_table, |
1217 | }, | 1183 | }, |
1218 | { .ctl_name = 0 } | 1184 | { } |
1219 | }; | 1185 | }; |
1220 | 1186 | ||
1221 | /* Make sure that /proc/sys/dev is there */ | ||
1222 | //static ctl_table arlan_device_root_table[] = | ||
1223 | //{ | ||
1224 | // {CTL_DEV, "dev", NULL, 0, 0555, arlan_root_table}, | ||
1225 | // {0} | ||
1226 | //}; | ||
1227 | |||
1228 | 1187 | ||
1229 | static struct ctl_table_header *arlan_device_sysctl_header; | 1188 | static struct ctl_table_header *arlan_device_sysctl_header; |
1230 | 1189 | ||
@@ -1234,8 +1193,6 @@ int __init init_arlan_proc(void) | |||
1234 | int i = 0; | 1193 | int i = 0; |
1235 | if (arlan_device_sysctl_header) | 1194 | if (arlan_device_sysctl_header) |
1236 | return 0; | 1195 | return 0; |
1237 | for (i = 0; i < MAX_ARLANS && arlan_device[i]; i++) | ||
1238 | arlan_table[i].ctl_name = i + 1; | ||
1239 | arlan_device_sysctl_header = register_sysctl_table(arlan_root_table); | 1196 | arlan_device_sysctl_header = register_sysctl_table(arlan_root_table); |
1240 | if (!arlan_device_sysctl_header) | 1197 | if (!arlan_device_sysctl_header) |
1241 | return -1; | 1198 | return -1; |
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 8eefe56f1cbe..3f56bc086cb5 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c | |||
@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write, | |||
233 | return copy_to_user(result, buffer, len) ? -EFAULT : 0; | 233 | return copy_to_user(result, buffer, len) ? -EFAULT : 0; |
234 | } | 234 | } |
235 | 235 | ||
236 | #define PARPORT_PORT_DIR(CHILD) { .ctl_name = 0, .procname = NULL, .mode = 0555, .child = CHILD } | 236 | #define PARPORT_PORT_DIR(CHILD) { .procname = NULL, .mode = 0555, .child = CHILD } |
237 | #define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \ | 237 | #define PARPORT_PARPORT_DIR(CHILD) { .procname = "parport", \ |
238 | .mode = 0555, .child = CHILD } | 238 | .mode = 0555, .child = CHILD } |
239 | #define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD } | 239 | #define PARPORT_DEV_DIR(CHILD) { .procname = "dev", .mode = 0555, .child = CHILD } |
240 | #define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ | 240 | #define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ |
241 | .mode = 0555, .child = NULL } | 241 | .mode = 0555, .child = NULL } |
242 | 242 | ||
@@ -270,7 +270,7 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
270 | .data = NULL, | 270 | .data = NULL, |
271 | .maxlen = sizeof(int), | 271 | .maxlen = sizeof(int), |
272 | .mode = 0644, | 272 | .mode = 0644, |
273 | .proc_handler = &proc_dointvec_minmax, | 273 | .proc_handler = proc_dointvec_minmax, |
274 | .extra1 = (void*) &parport_min_spintime_value, | 274 | .extra1 = (void*) &parport_min_spintime_value, |
275 | .extra2 = (void*) &parport_max_spintime_value | 275 | .extra2 = (void*) &parport_max_spintime_value |
276 | }, | 276 | }, |
@@ -279,28 +279,28 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
279 | .data = NULL, | 279 | .data = NULL, |
280 | .maxlen = 0, | 280 | .maxlen = 0, |
281 | .mode = 0444, | 281 | .mode = 0444, |
282 | .proc_handler = &do_hardware_base_addr | 282 | .proc_handler = do_hardware_base_addr |
283 | }, | 283 | }, |
284 | { | 284 | { |
285 | .procname = "irq", | 285 | .procname = "irq", |
286 | .data = NULL, | 286 | .data = NULL, |
287 | .maxlen = 0, | 287 | .maxlen = 0, |
288 | .mode = 0444, | 288 | .mode = 0444, |
289 | .proc_handler = &do_hardware_irq | 289 | .proc_handler = do_hardware_irq |
290 | }, | 290 | }, |
291 | { | 291 | { |
292 | .procname = "dma", | 292 | .procname = "dma", |
293 | .data = NULL, | 293 | .data = NULL, |
294 | .maxlen = 0, | 294 | .maxlen = 0, |
295 | .mode = 0444, | 295 | .mode = 0444, |
296 | .proc_handler = &do_hardware_dma | 296 | .proc_handler = do_hardware_dma |
297 | }, | 297 | }, |
298 | { | 298 | { |
299 | .procname = "modes", | 299 | .procname = "modes", |
300 | .data = NULL, | 300 | .data = NULL, |
301 | .maxlen = 0, | 301 | .maxlen = 0, |
302 | .mode = 0444, | 302 | .mode = 0444, |
303 | .proc_handler = &do_hardware_modes | 303 | .proc_handler = do_hardware_modes |
304 | }, | 304 | }, |
305 | PARPORT_DEVICES_ROOT_DIR, | 305 | PARPORT_DEVICES_ROOT_DIR, |
306 | #ifdef CONFIG_PARPORT_1284 | 306 | #ifdef CONFIG_PARPORT_1284 |
@@ -309,35 +309,35 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
309 | .data = NULL, | 309 | .data = NULL, |
310 | .maxlen = 0, | 310 | .maxlen = 0, |
311 | .mode = 0444, | 311 | .mode = 0444, |
312 | .proc_handler = &do_autoprobe | 312 | .proc_handler = do_autoprobe |
313 | }, | 313 | }, |
314 | { | 314 | { |
315 | .procname = "autoprobe0", | 315 | .procname = "autoprobe0", |
316 | .data = NULL, | 316 | .data = NULL, |
317 | .maxlen = 0, | 317 | .maxlen = 0, |
318 | .mode = 0444, | 318 | .mode = 0444, |
319 | .proc_handler = &do_autoprobe | 319 | .proc_handler = do_autoprobe |
320 | }, | 320 | }, |
321 | { | 321 | { |
322 | .procname = "autoprobe1", | 322 | .procname = "autoprobe1", |
323 | .data = NULL, | 323 | .data = NULL, |
324 | .maxlen = 0, | 324 | .maxlen = 0, |
325 | .mode = 0444, | 325 | .mode = 0444, |
326 | .proc_handler = &do_autoprobe | 326 | .proc_handler = do_autoprobe |
327 | }, | 327 | }, |
328 | { | 328 | { |
329 | .procname = "autoprobe2", | 329 | .procname = "autoprobe2", |
330 | .data = NULL, | 330 | .data = NULL, |
331 | .maxlen = 0, | 331 | .maxlen = 0, |
332 | .mode = 0444, | 332 | .mode = 0444, |
333 | .proc_handler = &do_autoprobe | 333 | .proc_handler = do_autoprobe |
334 | }, | 334 | }, |
335 | { | 335 | { |
336 | .procname = "autoprobe3", | 336 | .procname = "autoprobe3", |
337 | .data = NULL, | 337 | .data = NULL, |
338 | .maxlen = 0, | 338 | .maxlen = 0, |
339 | .mode = 0444, | 339 | .mode = 0444, |
340 | .proc_handler = &do_autoprobe | 340 | .proc_handler = do_autoprobe |
341 | }, | 341 | }, |
342 | #endif /* IEEE 1284 support */ | 342 | #endif /* IEEE 1284 support */ |
343 | {} | 343 | {} |
@@ -348,7 +348,7 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
348 | .data = NULL, | 348 | .data = NULL, |
349 | .maxlen = 0, | 349 | .maxlen = 0, |
350 | .mode = 0444, | 350 | .mode = 0444, |
351 | .proc_handler = &do_active_device | 351 | .proc_handler = do_active_device |
352 | }, | 352 | }, |
353 | {} | 353 | {} |
354 | }, | 354 | }, |
@@ -386,14 +386,13 @@ parport_device_sysctl_template = { | |||
386 | .data = NULL, | 386 | .data = NULL, |
387 | .maxlen = sizeof(unsigned long), | 387 | .maxlen = sizeof(unsigned long), |
388 | .mode = 0644, | 388 | .mode = 0644, |
389 | .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | 389 | .proc_handler = proc_doulongvec_ms_jiffies_minmax, |
390 | .extra1 = (void*) &parport_min_timeslice_value, | 390 | .extra1 = (void*) &parport_min_timeslice_value, |
391 | .extra2 = (void*) &parport_max_timeslice_value | 391 | .extra2 = (void*) &parport_max_timeslice_value |
392 | }, | 392 | }, |
393 | }, | 393 | }, |
394 | { | 394 | { |
395 | { | 395 | { |
396 | .ctl_name = 0, | ||
397 | .procname = NULL, | 396 | .procname = NULL, |
398 | .data = NULL, | 397 | .data = NULL, |
399 | .maxlen = 0, | 398 | .maxlen = 0, |
@@ -438,7 +437,7 @@ parport_default_sysctl_table = { | |||
438 | .data = &parport_default_timeslice, | 437 | .data = &parport_default_timeslice, |
439 | .maxlen = sizeof(parport_default_timeslice), | 438 | .maxlen = sizeof(parport_default_timeslice), |
440 | .mode = 0644, | 439 | .mode = 0644, |
441 | .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | 440 | .proc_handler = proc_doulongvec_ms_jiffies_minmax, |
442 | .extra1 = (void*) &parport_min_timeslice_value, | 441 | .extra1 = (void*) &parport_min_timeslice_value, |
443 | .extra2 = (void*) &parport_max_timeslice_value | 442 | .extra2 = (void*) &parport_max_timeslice_value |
444 | }, | 443 | }, |
@@ -447,7 +446,7 @@ parport_default_sysctl_table = { | |||
447 | .data = &parport_default_spintime, | 446 | .data = &parport_default_spintime, |
448 | .maxlen = sizeof(parport_default_spintime), | 447 | .maxlen = sizeof(parport_default_spintime), |
449 | .mode = 0644, | 448 | .mode = 0644, |
450 | .proc_handler = &proc_dointvec_minmax, | 449 | .proc_handler = proc_dointvec_minmax, |
451 | .extra1 = (void*) &parport_min_spintime_value, | 450 | .extra1 = (void*) &parport_min_spintime_value, |
452 | .extra2 = (void*) &parport_max_spintime_value | 451 | .extra2 = (void*) &parport_max_spintime_value |
453 | }, | 452 | }, |
@@ -455,7 +454,6 @@ parport_default_sysctl_table = { | |||
455 | }, | 454 | }, |
456 | { | 455 | { |
457 | { | 456 | { |
458 | .ctl_name = DEV_PARPORT_DEFAULT, | ||
459 | .procname = "default", | 457 | .procname = "default", |
460 | .mode = 0555, | 458 | .mode = 0555, |
461 | .child = parport_default_sysctl_table.vars | 459 | .child = parport_default_sysctl_table.vars |
@@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port) | |||
495 | t->vars[6 + i].extra2 = &port->probe_info[i]; | 493 | t->vars[6 + i].extra2 = &port->probe_info[i]; |
496 | 494 | ||
497 | t->port_dir[0].procname = port->name; | 495 | t->port_dir[0].procname = port->name; |
498 | t->port_dir[0].ctl_name = 0; | ||
499 | 496 | ||
500 | t->port_dir[0].child = t->vars; | 497 | t->port_dir[0].child = t->vars; |
501 | t->parport_dir[0].child = t->port_dir; | 498 | t->parport_dir[0].child = t->port_dir; |
@@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device) | |||
534 | t->dev_dir[0].child = t->parport_dir; | 531 | t->dev_dir[0].child = t->parport_dir; |
535 | t->parport_dir[0].child = t->port_dir; | 532 | t->parport_dir[0].child = t->port_dir; |
536 | t->port_dir[0].procname = port->name; | 533 | t->port_dir[0].procname = port->name; |
537 | t->port_dir[0].ctl_name = 0; | ||
538 | t->port_dir[0].child = t->devices_root_dir; | 534 | t->port_dir[0].child = t->devices_root_dir; |
539 | t->devices_root_dir[0].child = t->device_dir; | 535 | t->devices_root_dir[0].child = t->device_dir; |
540 | 536 | ||
541 | t->device_dir[0].ctl_name = 0; | ||
542 | t->device_dir[0].procname = device->name; | 537 | t->device_dir[0].procname = device->name; |
543 | t->device_dir[0].child = t->vars; | 538 | t->device_dir[0].child = t->vars; |
544 | t->vars[0].data = &device->timeslice; | 539 | t->vars[0].data = &device->timeslice; |
diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c index b44462a6c6d3..740fe405c395 100644 --- a/drivers/s390/char/sclp_async.c +++ b/drivers/s390/char/sclp_async.c | |||
@@ -101,18 +101,17 @@ static struct ctl_table callhome_table[] = { | |||
101 | .mode = 0644, | 101 | .mode = 0644, |
102 | .proc_handler = proc_handler_callhome, | 102 | .proc_handler = proc_handler_callhome, |
103 | }, | 103 | }, |
104 | { .ctl_name = 0 } | 104 | {} |
105 | }; | 105 | }; |
106 | 106 | ||
107 | static struct ctl_table kern_dir_table[] = { | 107 | static struct ctl_table kern_dir_table[] = { |
108 | { | 108 | { |
109 | .ctl_name = CTL_KERN, | ||
110 | .procname = "kernel", | 109 | .procname = "kernel", |
111 | .maxlen = 0, | 110 | .maxlen = 0, |
112 | .mode = 0555, | 111 | .mode = 0555, |
113 | .child = callhome_table, | 112 | .child = callhome_table, |
114 | }, | 113 | }, |
115 | { .ctl_name = 0 } | 114 | {} |
116 | }; | 115 | }; |
117 | 116 | ||
118 | /* | 117 | /* |
diff --git a/drivers/scsi/scsi_sysctl.c b/drivers/scsi/scsi_sysctl.c index 63a30f566f3a..2b6b93f7d8ef 100644 --- a/drivers/scsi/scsi_sysctl.c +++ b/drivers/scsi/scsi_sysctl.c | |||
@@ -13,26 +13,23 @@ | |||
13 | 13 | ||
14 | 14 | ||
15 | static ctl_table scsi_table[] = { | 15 | static ctl_table scsi_table[] = { |
16 | { .ctl_name = DEV_SCSI_LOGGING_LEVEL, | 16 | { .procname = "logging_level", |
17 | .procname = "logging_level", | ||
18 | .data = &scsi_logging_level, | 17 | .data = &scsi_logging_level, |
19 | .maxlen = sizeof(scsi_logging_level), | 18 | .maxlen = sizeof(scsi_logging_level), |
20 | .mode = 0644, | 19 | .mode = 0644, |
21 | .proc_handler = &proc_dointvec }, | 20 | .proc_handler = proc_dointvec }, |
22 | { } | 21 | { } |
23 | }; | 22 | }; |
24 | 23 | ||
25 | static ctl_table scsi_dir_table[] = { | 24 | static ctl_table scsi_dir_table[] = { |
26 | { .ctl_name = DEV_SCSI, | 25 | { .procname = "scsi", |
27 | .procname = "scsi", | ||
28 | .mode = 0555, | 26 | .mode = 0555, |
29 | .child = scsi_table }, | 27 | .child = scsi_table }, |
30 | { } | 28 | { } |
31 | }; | 29 | }; |
32 | 30 | ||
33 | static ctl_table scsi_root_table[] = { | 31 | static ctl_table scsi_root_table[] = { |
34 | { .ctl_name = CTL_DEV, | 32 | { .procname = "dev", |
35 | .procname = "dev", | ||
36 | .mode = 0555, | 33 | .mode = 0555, |
37 | .child = scsi_dir_table }, | 34 | .child = scsi_dir_table }, |
38 | { } | 35 | { } |
diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c index 43c96ce29614..c6405ce3c50e 100644 --- a/fs/coda/sysctl.c +++ b/fs/coda/sysctl.c | |||
@@ -17,28 +17,25 @@ static struct ctl_table_header *fs_table_header; | |||
17 | 17 | ||
18 | static ctl_table coda_table[] = { | 18 | static ctl_table coda_table[] = { |
19 | { | 19 | { |
20 | .ctl_name = CTL_UNNUMBERED, | ||
21 | .procname = "timeout", | 20 | .procname = "timeout", |
22 | .data = &coda_timeout, | 21 | .data = &coda_timeout, |
23 | .maxlen = sizeof(int), | 22 | .maxlen = sizeof(int), |
24 | .mode = 0644, | 23 | .mode = 0644, |
25 | .proc_handler = &proc_dointvec | 24 | .proc_handler = proc_dointvec |
26 | }, | 25 | }, |
27 | { | 26 | { |
28 | .ctl_name = CTL_UNNUMBERED, | ||
29 | .procname = "hard", | 27 | .procname = "hard", |
30 | .data = &coda_hard, | 28 | .data = &coda_hard, |
31 | .maxlen = sizeof(int), | 29 | .maxlen = sizeof(int), |
32 | .mode = 0644, | 30 | .mode = 0644, |
33 | .proc_handler = &proc_dointvec | 31 | .proc_handler = proc_dointvec |
34 | }, | 32 | }, |
35 | { | 33 | { |
36 | .ctl_name = CTL_UNNUMBERED, | ||
37 | .procname = "fake_statfs", | 34 | .procname = "fake_statfs", |
38 | .data = &coda_fake_statfs, | 35 | .data = &coda_fake_statfs, |
39 | .maxlen = sizeof(int), | 36 | .maxlen = sizeof(int), |
40 | .mode = 0600, | 37 | .mode = 0600, |
41 | .proc_handler = &proc_dointvec | 38 | .proc_handler = proc_dointvec |
42 | }, | 39 | }, |
43 | {} | 40 | {} |
44 | }; | 41 | }; |
@@ -46,7 +43,6 @@ static ctl_table coda_table[] = { | |||
46 | #ifdef CONFIG_SYSCTL | 43 | #ifdef CONFIG_SYSCTL |
47 | static ctl_table fs_table[] = { | 44 | static ctl_table fs_table[] = { |
48 | { | 45 | { |
49 | .ctl_name = CTL_UNNUMBERED, | ||
50 | .procname = "coda", | 46 | .procname = "coda", |
51 | .mode = 0555, | 47 | .mode = 0555, |
52 | .child = coda_table | 48 | .child = coda_table |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 085c5c063420..366c503f9657 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -251,10 +251,10 @@ ctl_table epoll_table[] = { | |||
251 | .data = &max_user_watches, | 251 | .data = &max_user_watches, |
252 | .maxlen = sizeof(int), | 252 | .maxlen = sizeof(int), |
253 | .mode = 0644, | 253 | .mode = 0644, |
254 | .proc_handler = &proc_dointvec_minmax, | 254 | .proc_handler = proc_dointvec_minmax, |
255 | .extra1 = &zero, | 255 | .extra1 = &zero, |
256 | }, | 256 | }, |
257 | { .ctl_name = 0 } | 257 | { } |
258 | }; | 258 | }; |
259 | #endif /* CONFIG_SYSCTL */ | 259 | #endif /* CONFIG_SYSCTL */ |
260 | 260 | ||
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 1a54ae14a192..e50cfa3d9654 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -371,82 +371,74 @@ EXPORT_SYMBOL_GPL(lockd_down); | |||
371 | 371 | ||
372 | static ctl_table nlm_sysctls[] = { | 372 | static ctl_table nlm_sysctls[] = { |
373 | { | 373 | { |
374 | .ctl_name = CTL_UNNUMBERED, | ||
375 | .procname = "nlm_grace_period", | 374 | .procname = "nlm_grace_period", |
376 | .data = &nlm_grace_period, | 375 | .data = &nlm_grace_period, |
377 | .maxlen = sizeof(unsigned long), | 376 | .maxlen = sizeof(unsigned long), |
378 | .mode = 0644, | 377 | .mode = 0644, |
379 | .proc_handler = &proc_doulongvec_minmax, | 378 | .proc_handler = proc_doulongvec_minmax, |
380 | .extra1 = (unsigned long *) &nlm_grace_period_min, | 379 | .extra1 = (unsigned long *) &nlm_grace_period_min, |
381 | .extra2 = (unsigned long *) &nlm_grace_period_max, | 380 | .extra2 = (unsigned long *) &nlm_grace_period_max, |
382 | }, | 381 | }, |
383 | { | 382 | { |
384 | .ctl_name = CTL_UNNUMBERED, | ||
385 | .procname = "nlm_timeout", | 383 | .procname = "nlm_timeout", |
386 | .data = &nlm_timeout, | 384 | .data = &nlm_timeout, |
387 | .maxlen = sizeof(unsigned long), | 385 | .maxlen = sizeof(unsigned long), |
388 | .mode = 0644, | 386 | .mode = 0644, |
389 | .proc_handler = &proc_doulongvec_minmax, | 387 | .proc_handler = proc_doulongvec_minmax, |
390 | .extra1 = (unsigned long *) &nlm_timeout_min, | 388 | .extra1 = (unsigned long *) &nlm_timeout_min, |
391 | .extra2 = (unsigned long *) &nlm_timeout_max, | 389 | .extra2 = (unsigned long *) &nlm_timeout_max, |
392 | }, | 390 | }, |
393 | { | 391 | { |
394 | .ctl_name = CTL_UNNUMBERED, | ||
395 | .procname = "nlm_udpport", | 392 | .procname = "nlm_udpport", |
396 | .data = &nlm_udpport, | 393 | .data = &nlm_udpport, |
397 | .maxlen = sizeof(int), | 394 | .maxlen = sizeof(int), |
398 | .mode = 0644, | 395 | .mode = 0644, |
399 | .proc_handler = &proc_dointvec_minmax, | 396 | .proc_handler = proc_dointvec_minmax, |
400 | .extra1 = (int *) &nlm_port_min, | 397 | .extra1 = (int *) &nlm_port_min, |
401 | .extra2 = (int *) &nlm_port_max, | 398 | .extra2 = (int *) &nlm_port_max, |
402 | }, | 399 | }, |
403 | { | 400 | { |
404 | .ctl_name = CTL_UNNUMBERED, | ||
405 | .procname = "nlm_tcpport", | 401 | .procname = "nlm_tcpport", |
406 | .data = &nlm_tcpport, | 402 | .data = &nlm_tcpport, |
407 | .maxlen = sizeof(int), | 403 | .maxlen = sizeof(int), |
408 | .mode = 0644, | 404 | .mode = 0644, |
409 | .proc_handler = &proc_dointvec_minmax, | 405 | .proc_handler = proc_dointvec_minmax, |
410 | .extra1 = (int *) &nlm_port_min, | 406 | .extra1 = (int *) &nlm_port_min, |
411 | .extra2 = (int *) &nlm_port_max, | 407 | .extra2 = (int *) &nlm_port_max, |
412 | }, | 408 | }, |
413 | { | 409 | { |
414 | .ctl_name = CTL_UNNUMBERED, | ||
415 | .procname = "nsm_use_hostnames", | 410 | .procname = "nsm_use_hostnames", |
416 | .data = &nsm_use_hostnames, | 411 | .data = &nsm_use_hostnames, |
417 | .maxlen = sizeof(int), | 412 | .maxlen = sizeof(int), |
418 | .mode = 0644, | 413 | .mode = 0644, |
419 | .proc_handler = &proc_dointvec, | 414 | .proc_handler = proc_dointvec, |
420 | }, | 415 | }, |
421 | { | 416 | { |
422 | .ctl_name = CTL_UNNUMBERED, | ||
423 | .procname = "nsm_local_state", | 417 | .procname = "nsm_local_state", |
424 | .data = &nsm_local_state, | 418 | .data = &nsm_local_state, |
425 | .maxlen = sizeof(int), | 419 | .maxlen = sizeof(int), |
426 | .mode = 0644, | 420 | .mode = 0644, |
427 | .proc_handler = &proc_dointvec, | 421 | .proc_handler = proc_dointvec, |
428 | }, | 422 | }, |
429 | { .ctl_name = 0 } | 423 | { } |
430 | }; | 424 | }; |
431 | 425 | ||
432 | static ctl_table nlm_sysctl_dir[] = { | 426 | static ctl_table nlm_sysctl_dir[] = { |
433 | { | 427 | { |
434 | .ctl_name = CTL_UNNUMBERED, | ||
435 | .procname = "nfs", | 428 | .procname = "nfs", |
436 | .mode = 0555, | 429 | .mode = 0555, |
437 | .child = nlm_sysctls, | 430 | .child = nlm_sysctls, |
438 | }, | 431 | }, |
439 | { .ctl_name = 0 } | 432 | { } |
440 | }; | 433 | }; |
441 | 434 | ||
442 | static ctl_table nlm_sysctl_root[] = { | 435 | static ctl_table nlm_sysctl_root[] = { |
443 | { | 436 | { |
444 | .ctl_name = CTL_FS, | ||
445 | .procname = "fs", | 437 | .procname = "fs", |
446 | .mode = 0555, | 438 | .mode = 0555, |
447 | .child = nlm_sysctl_dir, | 439 | .child = nlm_sysctl_dir, |
448 | }, | 440 | }, |
449 | { .ctl_name = 0 } | 441 | { } |
450 | }; | 442 | }; |
451 | 443 | ||
452 | #endif /* CONFIG_SYSCTL */ | 444 | #endif /* CONFIG_SYSCTL */ |
diff --git a/fs/nfs/sysctl.c b/fs/nfs/sysctl.c index b62481dabae9..70e1fbbaaeab 100644 --- a/fs/nfs/sysctl.c +++ b/fs/nfs/sysctl.c | |||
@@ -22,63 +22,55 @@ static struct ctl_table_header *nfs_callback_sysctl_table; | |||
22 | static ctl_table nfs_cb_sysctls[] = { | 22 | static ctl_table nfs_cb_sysctls[] = { |
23 | #ifdef CONFIG_NFS_V4 | 23 | #ifdef CONFIG_NFS_V4 |
24 | { | 24 | { |
25 | .ctl_name = CTL_UNNUMBERED, | ||
26 | .procname = "nfs_callback_tcpport", | 25 | .procname = "nfs_callback_tcpport", |
27 | .data = &nfs_callback_set_tcpport, | 26 | .data = &nfs_callback_set_tcpport, |
28 | .maxlen = sizeof(int), | 27 | .maxlen = sizeof(int), |
29 | .mode = 0644, | 28 | .mode = 0644, |
30 | .proc_handler = &proc_dointvec_minmax, | 29 | .proc_handler = proc_dointvec_minmax, |
31 | .extra1 = (int *)&nfs_set_port_min, | 30 | .extra1 = (int *)&nfs_set_port_min, |
32 | .extra2 = (int *)&nfs_set_port_max, | 31 | .extra2 = (int *)&nfs_set_port_max, |
33 | }, | 32 | }, |
34 | { | 33 | { |
35 | .ctl_name = CTL_UNNUMBERED, | ||
36 | .procname = "idmap_cache_timeout", | 34 | .procname = "idmap_cache_timeout", |
37 | .data = &nfs_idmap_cache_timeout, | 35 | .data = &nfs_idmap_cache_timeout, |
38 | .maxlen = sizeof(int), | 36 | .maxlen = sizeof(int), |
39 | .mode = 0644, | 37 | .mode = 0644, |
40 | .proc_handler = &proc_dointvec_jiffies, | 38 | .proc_handler = proc_dointvec_jiffies, |
41 | .strategy = &sysctl_jiffies, | ||
42 | }, | 39 | }, |
43 | #endif | 40 | #endif |
44 | { | 41 | { |
45 | .ctl_name = CTL_UNNUMBERED, | ||
46 | .procname = "nfs_mountpoint_timeout", | 42 | .procname = "nfs_mountpoint_timeout", |
47 | .data = &nfs_mountpoint_expiry_timeout, | 43 | .data = &nfs_mountpoint_expiry_timeout, |
48 | .maxlen = sizeof(nfs_mountpoint_expiry_timeout), | 44 | .maxlen = sizeof(nfs_mountpoint_expiry_timeout), |
49 | .mode = 0644, | 45 | .mode = 0644, |
50 | .proc_handler = &proc_dointvec_jiffies, | 46 | .proc_handler = proc_dointvec_jiffies, |
51 | .strategy = &sysctl_jiffies, | ||
52 | }, | 47 | }, |
53 | { | 48 | { |
54 | .ctl_name = CTL_UNNUMBERED, | ||
55 | .procname = "nfs_congestion_kb", | 49 | .procname = "nfs_congestion_kb", |
56 | .data = &nfs_congestion_kb, | 50 | .data = &nfs_congestion_kb, |
57 | .maxlen = sizeof(nfs_congestion_kb), | 51 | .maxlen = sizeof(nfs_congestion_kb), |
58 | .mode = 0644, | 52 | .mode = 0644, |
59 | .proc_handler = &proc_dointvec, | 53 | .proc_handler = proc_dointvec, |
60 | }, | 54 | }, |
61 | { .ctl_name = 0 } | 55 | { } |
62 | }; | 56 | }; |
63 | 57 | ||
64 | static ctl_table nfs_cb_sysctl_dir[] = { | 58 | static ctl_table nfs_cb_sysctl_dir[] = { |
65 | { | 59 | { |
66 | .ctl_name = CTL_UNNUMBERED, | ||
67 | .procname = "nfs", | 60 | .procname = "nfs", |
68 | .mode = 0555, | 61 | .mode = 0555, |
69 | .child = nfs_cb_sysctls, | 62 | .child = nfs_cb_sysctls, |
70 | }, | 63 | }, |
71 | { .ctl_name = 0 } | 64 | { } |
72 | }; | 65 | }; |
73 | 66 | ||
74 | static ctl_table nfs_cb_sysctl_root[] = { | 67 | static ctl_table nfs_cb_sysctl_root[] = { |
75 | { | 68 | { |
76 | .ctl_name = CTL_FS, | ||
77 | .procname = "fs", | 69 | .procname = "fs", |
78 | .mode = 0555, | 70 | .mode = 0555, |
79 | .child = nfs_cb_sysctl_dir, | 71 | .child = nfs_cb_sysctl_dir, |
80 | }, | 72 | }, |
81 | { .ctl_name = 0 } | 73 | { } |
82 | }; | 74 | }; |
83 | 75 | ||
84 | int nfs_register_sysctl(void) | 76 | int nfs_register_sysctl(void) |
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index dcd2040d330c..1d1d1a2765dd 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -69,36 +69,30 @@ static int zero; | |||
69 | 69 | ||
70 | ctl_table inotify_table[] = { | 70 | ctl_table inotify_table[] = { |
71 | { | 71 | { |
72 | .ctl_name = INOTIFY_MAX_USER_INSTANCES, | ||
73 | .procname = "max_user_instances", | 72 | .procname = "max_user_instances", |
74 | .data = &inotify_max_user_instances, | 73 | .data = &inotify_max_user_instances, |
75 | .maxlen = sizeof(int), | 74 | .maxlen = sizeof(int), |
76 | .mode = 0644, | 75 | .mode = 0644, |
77 | .proc_handler = &proc_dointvec_minmax, | 76 | .proc_handler = proc_dointvec_minmax, |
78 | .strategy = &sysctl_intvec, | ||
79 | .extra1 = &zero, | 77 | .extra1 = &zero, |
80 | }, | 78 | }, |
81 | { | 79 | { |
82 | .ctl_name = INOTIFY_MAX_USER_WATCHES, | ||
83 | .procname = "max_user_watches", | 80 | .procname = "max_user_watches", |
84 | .data = &inotify_max_user_watches, | 81 | .data = &inotify_max_user_watches, |
85 | .maxlen = sizeof(int), | 82 | .maxlen = sizeof(int), |
86 | .mode = 0644, | 83 | .mode = 0644, |
87 | .proc_handler = &proc_dointvec_minmax, | 84 | .proc_handler = proc_dointvec_minmax, |
88 | .strategy = &sysctl_intvec, | ||
89 | .extra1 = &zero, | 85 | .extra1 = &zero, |
90 | }, | 86 | }, |
91 | { | 87 | { |
92 | .ctl_name = INOTIFY_MAX_QUEUED_EVENTS, | ||
93 | .procname = "max_queued_events", | 88 | .procname = "max_queued_events", |
94 | .data = &inotify_max_queued_events, | 89 | .data = &inotify_max_queued_events, |
95 | .maxlen = sizeof(int), | 90 | .maxlen = sizeof(int), |
96 | .mode = 0644, | 91 | .mode = 0644, |
97 | .proc_handler = &proc_dointvec_minmax, | 92 | .proc_handler = proc_dointvec_minmax, |
98 | .strategy = &sysctl_intvec, | ||
99 | .extra1 = &zero | 93 | .extra1 = &zero |
100 | }, | 94 | }, |
101 | { .ctl_name = 0 } | 95 | { } |
102 | }; | 96 | }; |
103 | #endif /* CONFIG_SYSCTL */ | 97 | #endif /* CONFIG_SYSCTL */ |
104 | 98 | ||
diff --git a/fs/ntfs/sysctl.c b/fs/ntfs/sysctl.c index 9ef85e628fe1..79a89184cb5e 100644 --- a/fs/ntfs/sysctl.c +++ b/fs/ntfs/sysctl.c | |||
@@ -36,12 +36,11 @@ | |||
36 | /* Definition of the ntfs sysctl. */ | 36 | /* Definition of the ntfs sysctl. */ |
37 | static ctl_table ntfs_sysctls[] = { | 37 | static ctl_table ntfs_sysctls[] = { |
38 | { | 38 | { |
39 | .ctl_name = CTL_UNNUMBERED, /* Binary and text IDs. */ | ||
40 | .procname = "ntfs-debug", | 39 | .procname = "ntfs-debug", |
41 | .data = &debug_msgs, /* Data pointer and size. */ | 40 | .data = &debug_msgs, /* Data pointer and size. */ |
42 | .maxlen = sizeof(debug_msgs), | 41 | .maxlen = sizeof(debug_msgs), |
43 | .mode = 0644, /* Mode, proc handler. */ | 42 | .mode = 0644, /* Mode, proc handler. */ |
44 | .proc_handler = &proc_dointvec | 43 | .proc_handler = proc_dointvec |
45 | }, | 44 | }, |
46 | {} | 45 | {} |
47 | }; | 46 | }; |
@@ -49,7 +48,6 @@ static ctl_table ntfs_sysctls[] = { | |||
49 | /* Define the parent directory /proc/sys/fs. */ | 48 | /* Define the parent directory /proc/sys/fs. */ |
50 | static ctl_table sysctls_root[] = { | 49 | static ctl_table sysctls_root[] = { |
51 | { | 50 | { |
52 | .ctl_name = CTL_FS, | ||
53 | .procname = "fs", | 51 | .procname = "fs", |
54 | .mode = 0555, | 52 | .mode = 0555, |
55 | .child = ntfs_sysctls | 53 | .child = ntfs_sysctls |
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 3f2f1c45b7b6..f3df0baa9a48 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c | |||
@@ -620,51 +620,46 @@ error: | |||
620 | 620 | ||
621 | static ctl_table ocfs2_nm_table[] = { | 621 | static ctl_table ocfs2_nm_table[] = { |
622 | { | 622 | { |
623 | .ctl_name = 1, | ||
624 | .procname = "hb_ctl_path", | 623 | .procname = "hb_ctl_path", |
625 | .data = ocfs2_hb_ctl_path, | 624 | .data = ocfs2_hb_ctl_path, |
626 | .maxlen = OCFS2_MAX_HB_CTL_PATH, | 625 | .maxlen = OCFS2_MAX_HB_CTL_PATH, |
627 | .mode = 0644, | 626 | .mode = 0644, |
628 | .proc_handler = &proc_dostring, | 627 | .proc_handler = proc_dostring, |
629 | .strategy = &sysctl_string, | ||
630 | }, | 628 | }, |
631 | { .ctl_name = 0 } | 629 | { } |
632 | }; | 630 | }; |
633 | 631 | ||
634 | static ctl_table ocfs2_mod_table[] = { | 632 | static ctl_table ocfs2_mod_table[] = { |
635 | { | 633 | { |
636 | .ctl_name = FS_OCFS2_NM, | ||
637 | .procname = "nm", | 634 | .procname = "nm", |
638 | .data = NULL, | 635 | .data = NULL, |
639 | .maxlen = 0, | 636 | .maxlen = 0, |
640 | .mode = 0555, | 637 | .mode = 0555, |
641 | .child = ocfs2_nm_table | 638 | .child = ocfs2_nm_table |
642 | }, | 639 | }, |
643 | { .ctl_name = 0} | 640 | { } |
644 | }; | 641 | }; |
645 | 642 | ||
646 | static ctl_table ocfs2_kern_table[] = { | 643 | static ctl_table ocfs2_kern_table[] = { |
647 | { | 644 | { |
648 | .ctl_name = FS_OCFS2, | ||
649 | .procname = "ocfs2", | 645 | .procname = "ocfs2", |
650 | .data = NULL, | 646 | .data = NULL, |
651 | .maxlen = 0, | 647 | .maxlen = 0, |
652 | .mode = 0555, | 648 | .mode = 0555, |
653 | .child = ocfs2_mod_table | 649 | .child = ocfs2_mod_table |
654 | }, | 650 | }, |
655 | { .ctl_name = 0} | 651 | { } |
656 | }; | 652 | }; |
657 | 653 | ||
658 | static ctl_table ocfs2_root_table[] = { | 654 | static ctl_table ocfs2_root_table[] = { |
659 | { | 655 | { |
660 | .ctl_name = CTL_FS, | ||
661 | .procname = "fs", | 656 | .procname = "fs", |
662 | .data = NULL, | 657 | .data = NULL, |
663 | .maxlen = 0, | 658 | .maxlen = 0, |
664 | .mode = 0555, | 659 | .mode = 0555, |
665 | .child = ocfs2_kern_table | 660 | .child = ocfs2_kern_table |
666 | }, | 661 | }, |
667 | { .ctl_name = 0 } | 662 | { } |
668 | }; | 663 | }; |
669 | 664 | ||
670 | static struct ctl_table_header *ocfs2_table_header = NULL; | 665 | static struct ctl_table_header *ocfs2_table_header = NULL; |
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index f667e8aeabdf..6ff9981f0a18 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -48,7 +48,7 @@ out: | |||
48 | static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name) | 48 | static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name) |
49 | { | 49 | { |
50 | int len; | 50 | int len; |
51 | for ( ; p->ctl_name || p->procname; p++) { | 51 | for ( ; p->procname; p++) { |
52 | 52 | ||
53 | if (!p->procname) | 53 | if (!p->procname) |
54 | continue; | 54 | continue; |
@@ -218,7 +218,7 @@ static int scan(struct ctl_table_header *head, ctl_table *table, | |||
218 | void *dirent, filldir_t filldir) | 218 | void *dirent, filldir_t filldir) |
219 | { | 219 | { |
220 | 220 | ||
221 | for (; table->ctl_name || table->procname; table++, (*pos)++) { | 221 | for (; table->procname; table++, (*pos)++) { |
222 | int res; | 222 | int res; |
223 | 223 | ||
224 | /* Can't do anything without a proc name */ | 224 | /* Can't do anything without a proc name */ |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 9b6ad908dcb2..eb5a755718f6 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -2404,100 +2404,89 @@ const struct quotactl_ops vfs_quotactl_ops = { | |||
2404 | 2404 | ||
2405 | static ctl_table fs_dqstats_table[] = { | 2405 | static ctl_table fs_dqstats_table[] = { |
2406 | { | 2406 | { |
2407 | .ctl_name = FS_DQ_LOOKUPS, | ||
2408 | .procname = "lookups", | 2407 | .procname = "lookups", |
2409 | .data = &dqstats.lookups, | 2408 | .data = &dqstats.lookups, |
2410 | .maxlen = sizeof(int), | 2409 | .maxlen = sizeof(int), |
2411 | .mode = 0444, | 2410 | .mode = 0444, |
2412 | .proc_handler = &proc_dointvec, | 2411 | .proc_handler = proc_dointvec, |
2413 | }, | 2412 | }, |
2414 | { | 2413 | { |
2415 | .ctl_name = FS_DQ_DROPS, | ||
2416 | .procname = "drops", | 2414 | .procname = "drops", |
2417 | .data = &dqstats.drops, | 2415 | .data = &dqstats.drops, |
2418 | .maxlen = sizeof(int), | 2416 | .maxlen = sizeof(int), |
2419 | .mode = 0444, | 2417 | .mode = 0444, |
2420 | .proc_handler = &proc_dointvec, | 2418 | .proc_handler = proc_dointvec, |
2421 | }, | 2419 | }, |
2422 | { | 2420 | { |
2423 | .ctl_name = FS_DQ_READS, | ||
2424 | .procname = "reads", | 2421 | .procname = "reads", |
2425 | .data = &dqstats.reads, | 2422 | .data = &dqstats.reads, |
2426 | .maxlen = sizeof(int), | 2423 | .maxlen = sizeof(int), |
2427 | .mode = 0444, | 2424 | .mode = 0444, |
2428 | .proc_handler = &proc_dointvec, | 2425 | .proc_handler = proc_dointvec, |
2429 | }, | 2426 | }, |
2430 | { | 2427 | { |
2431 | .ctl_name = FS_DQ_WRITES, | ||
2432 | .procname = "writes", | 2428 | .procname = "writes", |
2433 | .data = &dqstats.writes, | 2429 | .data = &dqstats.writes, |
2434 | .maxlen = sizeof(int), | 2430 | .maxlen = sizeof(int), |
2435 | .mode = 0444, | 2431 | .mode = 0444, |
2436 | .proc_handler = &proc_dointvec, | 2432 | .proc_handler = proc_dointvec, |
2437 | }, | 2433 | }, |
2438 | { | 2434 | { |
2439 | .ctl_name = FS_DQ_CACHE_HITS, | ||
2440 | .procname = "cache_hits", | 2435 | .procname = "cache_hits", |
2441 | .data = &dqstats.cache_hits, | 2436 | .data = &dqstats.cache_hits, |
2442 | .maxlen = sizeof(int), | 2437 | .maxlen = sizeof(int), |
2443 | .mode = 0444, | 2438 | .mode = 0444, |
2444 | .proc_handler = &proc_dointvec, | 2439 | .proc_handler = proc_dointvec, |
2445 | }, | 2440 | }, |
2446 | { | 2441 | { |
2447 | .ctl_name = FS_DQ_ALLOCATED, | ||
2448 | .procname = "allocated_dquots", | 2442 | .procname = "allocated_dquots", |
2449 | .data = &dqstats.allocated_dquots, | 2443 | .data = &dqstats.allocated_dquots, |
2450 | .maxlen = sizeof(int), | 2444 | .maxlen = sizeof(int), |
2451 | .mode = 0444, | 2445 | .mode = 0444, |
2452 | .proc_handler = &proc_dointvec, | 2446 | .proc_handler = proc_dointvec, |
2453 | }, | 2447 | }, |
2454 | { | 2448 | { |
2455 | .ctl_name = FS_DQ_FREE, | ||
2456 | .procname = "free_dquots", | 2449 | .procname = "free_dquots", |
2457 | .data = &dqstats.free_dquots, | 2450 | .data = &dqstats.free_dquots, |
2458 | .maxlen = sizeof(int), | 2451 | .maxlen = sizeof(int), |
2459 | .mode = 0444, | 2452 | .mode = 0444, |
2460 | .proc_handler = &proc_dointvec, | 2453 | .proc_handler = proc_dointvec, |
2461 | }, | 2454 | }, |
2462 | { | 2455 | { |
2463 | .ctl_name = FS_DQ_SYNCS, | ||
2464 | .procname = "syncs", | 2456 | .procname = "syncs", |
2465 | .data = &dqstats.syncs, | 2457 | .data = &dqstats.syncs, |
2466 | .maxlen = sizeof(int), | 2458 | .maxlen = sizeof(int), |
2467 | .mode = 0444, | 2459 | .mode = 0444, |
2468 | .proc_handler = &proc_dointvec, | 2460 | .proc_handler = proc_dointvec, |
2469 | }, | 2461 | }, |
2470 | #ifdef CONFIG_PRINT_QUOTA_WARNING | 2462 | #ifdef CONFIG_PRINT_QUOTA_WARNING |
2471 | { | 2463 | { |
2472 | .ctl_name = FS_DQ_WARNINGS, | ||
2473 | .procname = "warnings", | 2464 | .procname = "warnings", |
2474 | .data = &flag_print_warnings, | 2465 | .data = &flag_print_warnings, |
2475 | .maxlen = sizeof(int), | 2466 | .maxlen = sizeof(int), |
2476 | .mode = 0644, | 2467 | .mode = 0644, |
2477 | .proc_handler = &proc_dointvec, | 2468 | .proc_handler = proc_dointvec, |
2478 | }, | 2469 | }, |
2479 | #endif | 2470 | #endif |
2480 | { .ctl_name = 0 }, | 2471 | { }, |
2481 | }; | 2472 | }; |
2482 | 2473 | ||
2483 | static ctl_table fs_table[] = { | 2474 | static ctl_table fs_table[] = { |
2484 | { | 2475 | { |
2485 | .ctl_name = FS_DQSTATS, | ||
2486 | .procname = "quota", | 2476 | .procname = "quota", |
2487 | .mode = 0555, | 2477 | .mode = 0555, |
2488 | .child = fs_dqstats_table, | 2478 | .child = fs_dqstats_table, |
2489 | }, | 2479 | }, |
2490 | { .ctl_name = 0 }, | 2480 | { }, |
2491 | }; | 2481 | }; |
2492 | 2482 | ||
2493 | static ctl_table sys_table[] = { | 2483 | static ctl_table sys_table[] = { |
2494 | { | 2484 | { |
2495 | .ctl_name = CTL_FS, | ||
2496 | .procname = "fs", | 2485 | .procname = "fs", |
2497 | .mode = 0555, | 2486 | .mode = 0555, |
2498 | .child = fs_table, | 2487 | .child = fs_table, |
2499 | }, | 2488 | }, |
2500 | { .ctl_name = 0 }, | 2489 | { }, |
2501 | }; | 2490 | }; |
2502 | 2491 | ||
2503 | static int __init dquot_init(void) | 2492 | static int __init dquot_init(void) |
diff --git a/fs/xfs/linux-2.6/xfs_sysctl.c b/fs/xfs/linux-2.6/xfs_sysctl.c index c5bc67c4e3bb..7bb5092d6ae4 100644 --- a/fs/xfs/linux-2.6/xfs_sysctl.c +++ b/fs/xfs/linux-2.6/xfs_sysctl.c | |||
@@ -55,170 +55,140 @@ xfs_stats_clear_proc_handler( | |||
55 | 55 | ||
56 | static ctl_table xfs_table[] = { | 56 | static ctl_table xfs_table[] = { |
57 | { | 57 | { |
58 | .ctl_name = XFS_SGID_INHERIT, | ||
59 | .procname = "irix_sgid_inherit", | 58 | .procname = "irix_sgid_inherit", |
60 | .data = &xfs_params.sgid_inherit.val, | 59 | .data = &xfs_params.sgid_inherit.val, |
61 | .maxlen = sizeof(int), | 60 | .maxlen = sizeof(int), |
62 | .mode = 0644, | 61 | .mode = 0644, |
63 | .proc_handler = &proc_dointvec_minmax, | 62 | .proc_handler = proc_dointvec_minmax, |
64 | .strategy = &sysctl_intvec, | ||
65 | .extra1 = &xfs_params.sgid_inherit.min, | 63 | .extra1 = &xfs_params.sgid_inherit.min, |
66 | .extra2 = &xfs_params.sgid_inherit.max | 64 | .extra2 = &xfs_params.sgid_inherit.max |
67 | }, | 65 | }, |
68 | { | 66 | { |
69 | .ctl_name = XFS_SYMLINK_MODE, | ||
70 | .procname = "irix_symlink_mode", | 67 | .procname = "irix_symlink_mode", |
71 | .data = &xfs_params.symlink_mode.val, | 68 | .data = &xfs_params.symlink_mode.val, |
72 | .maxlen = sizeof(int), | 69 | .maxlen = sizeof(int), |
73 | .mode = 0644, | 70 | .mode = 0644, |
74 | .proc_handler = &proc_dointvec_minmax, | 71 | .proc_handler = proc_dointvec_minmax, |
75 | .strategy = &sysctl_intvec, | ||
76 | .extra1 = &xfs_params.symlink_mode.min, | 72 | .extra1 = &xfs_params.symlink_mode.min, |
77 | .extra2 = &xfs_params.symlink_mode.max | 73 | .extra2 = &xfs_params.symlink_mode.max |
78 | }, | 74 | }, |
79 | { | 75 | { |
80 | .ctl_name = XFS_PANIC_MASK, | ||
81 | .procname = "panic_mask", | 76 | .procname = "panic_mask", |
82 | .data = &xfs_params.panic_mask.val, | 77 | .data = &xfs_params.panic_mask.val, |
83 | .maxlen = sizeof(int), | 78 | .maxlen = sizeof(int), |
84 | .mode = 0644, | 79 | .mode = 0644, |
85 | .proc_handler = &proc_dointvec_minmax, | 80 | .proc_handler = proc_dointvec_minmax, |
86 | .strategy = &sysctl_intvec, | ||
87 | .extra1 = &xfs_params.panic_mask.min, | 81 | .extra1 = &xfs_params.panic_mask.min, |
88 | .extra2 = &xfs_params.panic_mask.max | 82 | .extra2 = &xfs_params.panic_mask.max |
89 | }, | 83 | }, |
90 | 84 | ||
91 | { | 85 | { |
92 | .ctl_name = XFS_ERRLEVEL, | ||
93 | .procname = "error_level", | 86 | .procname = "error_level", |
94 | .data = &xfs_params.error_level.val, | 87 | .data = &xfs_params.error_level.val, |
95 | .maxlen = sizeof(int), | 88 | .maxlen = sizeof(int), |
96 | .mode = 0644, | 89 | .mode = 0644, |
97 | .proc_handler = &proc_dointvec_minmax, | 90 | .proc_handler = proc_dointvec_minmax, |
98 | .strategy = &sysctl_intvec, | ||
99 | .extra1 = &xfs_params.error_level.min, | 91 | .extra1 = &xfs_params.error_level.min, |
100 | .extra2 = &xfs_params.error_level.max | 92 | .extra2 = &xfs_params.error_level.max |
101 | }, | 93 | }, |
102 | { | 94 | { |
103 | .ctl_name = XFS_SYNCD_TIMER, | ||
104 | .procname = "xfssyncd_centisecs", | 95 | .procname = "xfssyncd_centisecs", |
105 | .data = &xfs_params.syncd_timer.val, | 96 | .data = &xfs_params.syncd_timer.val, |
106 | .maxlen = sizeof(int), | 97 | .maxlen = sizeof(int), |
107 | .mode = 0644, | 98 | .mode = 0644, |
108 | .proc_handler = &proc_dointvec_minmax, | 99 | .proc_handler = proc_dointvec_minmax, |
109 | .strategy = &sysctl_intvec, | ||
110 | .extra1 = &xfs_params.syncd_timer.min, | 100 | .extra1 = &xfs_params.syncd_timer.min, |
111 | .extra2 = &xfs_params.syncd_timer.max | 101 | .extra2 = &xfs_params.syncd_timer.max |
112 | }, | 102 | }, |
113 | { | 103 | { |
114 | .ctl_name = XFS_INHERIT_SYNC, | ||
115 | .procname = "inherit_sync", | 104 | .procname = "inherit_sync", |
116 | .data = &xfs_params.inherit_sync.val, | 105 | .data = &xfs_params.inherit_sync.val, |
117 | .maxlen = sizeof(int), | 106 | .maxlen = sizeof(int), |
118 | .mode = 0644, | 107 | .mode = 0644, |
119 | .proc_handler = &proc_dointvec_minmax, | 108 | .proc_handler = proc_dointvec_minmax, |
120 | .strategy = &sysctl_intvec, | ||
121 | .extra1 = &xfs_params.inherit_sync.min, | 109 | .extra1 = &xfs_params.inherit_sync.min, |
122 | .extra2 = &xfs_params.inherit_sync.max | 110 | .extra2 = &xfs_params.inherit_sync.max |
123 | }, | 111 | }, |
124 | { | 112 | { |
125 | .ctl_name = XFS_INHERIT_NODUMP, | ||
126 | .procname = "inherit_nodump", | 113 | .procname = "inherit_nodump", |
127 | .data = &xfs_params.inherit_nodump.val, | 114 | .data = &xfs_params.inherit_nodump.val, |
128 | .maxlen = sizeof(int), | 115 | .maxlen = sizeof(int), |
129 | .mode = 0644, | 116 | .mode = 0644, |
130 | .proc_handler = &proc_dointvec_minmax, | 117 | .proc_handler = proc_dointvec_minmax, |
131 | .strategy = &sysctl_intvec, | ||
132 | .extra1 = &xfs_params.inherit_nodump.min, | 118 | .extra1 = &xfs_params.inherit_nodump.min, |
133 | .extra2 = &xfs_params.inherit_nodump.max | 119 | .extra2 = &xfs_params.inherit_nodump.max |
134 | }, | 120 | }, |
135 | { | 121 | { |
136 | .ctl_name = XFS_INHERIT_NOATIME, | ||
137 | .procname = "inherit_noatime", | 122 | .procname = "inherit_noatime", |
138 | .data = &xfs_params.inherit_noatim.val, | 123 | .data = &xfs_params.inherit_noatim.val, |
139 | .maxlen = sizeof(int), | 124 | .maxlen = sizeof(int), |
140 | .mode = 0644, | 125 | .mode = 0644, |
141 | .proc_handler = &proc_dointvec_minmax, | 126 | .proc_handler = proc_dointvec_minmax, |
142 | .strategy = &sysctl_intvec, | ||
143 | .extra1 = &xfs_params.inherit_noatim.min, | 127 | .extra1 = &xfs_params.inherit_noatim.min, |
144 | .extra2 = &xfs_params.inherit_noatim.max | 128 | .extra2 = &xfs_params.inherit_noatim.max |
145 | }, | 129 | }, |
146 | { | 130 | { |
147 | .ctl_name = XFS_BUF_TIMER, | ||
148 | .procname = "xfsbufd_centisecs", | 131 | .procname = "xfsbufd_centisecs", |
149 | .data = &xfs_params.xfs_buf_timer.val, | 132 | .data = &xfs_params.xfs_buf_timer.val, |
150 | .maxlen = sizeof(int), | 133 | .maxlen = sizeof(int), |
151 | .mode = 0644, | 134 | .mode = 0644, |
152 | .proc_handler = &proc_dointvec_minmax, | 135 | .proc_handler = proc_dointvec_minmax, |
153 | .strategy = &sysctl_intvec, | ||
154 | .extra1 = &xfs_params.xfs_buf_timer.min, | 136 | .extra1 = &xfs_params.xfs_buf_timer.min, |
155 | .extra2 = &xfs_params.xfs_buf_timer.max | 137 | .extra2 = &xfs_params.xfs_buf_timer.max |
156 | }, | 138 | }, |
157 | { | 139 | { |
158 | .ctl_name = XFS_BUF_AGE, | ||
159 | .procname = "age_buffer_centisecs", | 140 | .procname = "age_buffer_centisecs", |
160 | .data = &xfs_params.xfs_buf_age.val, | 141 | .data = &xfs_params.xfs_buf_age.val, |
161 | .maxlen = sizeof(int), | 142 | .maxlen = sizeof(int), |
162 | .mode = 0644, | 143 | .mode = 0644, |
163 | .proc_handler = &proc_dointvec_minmax, | 144 | .proc_handler = proc_dointvec_minmax, |
164 | .strategy = &sysctl_intvec, | ||
165 | .extra1 = &xfs_params.xfs_buf_age.min, | 145 | .extra1 = &xfs_params.xfs_buf_age.min, |
166 | .extra2 = &xfs_params.xfs_buf_age.max | 146 | .extra2 = &xfs_params.xfs_buf_age.max |
167 | }, | 147 | }, |
168 | { | 148 | { |
169 | .ctl_name = XFS_INHERIT_NOSYM, | ||
170 | .procname = "inherit_nosymlinks", | 149 | .procname = "inherit_nosymlinks", |
171 | .data = &xfs_params.inherit_nosym.val, | 150 | .data = &xfs_params.inherit_nosym.val, |
172 | .maxlen = sizeof(int), | 151 | .maxlen = sizeof(int), |
173 | .mode = 0644, | 152 | .mode = 0644, |
174 | .proc_handler = &proc_dointvec_minmax, | 153 | .proc_handler = proc_dointvec_minmax, |
175 | .strategy = &sysctl_intvec, | ||
176 | .extra1 = &xfs_params.inherit_nosym.min, | 154 | .extra1 = &xfs_params.inherit_nosym.min, |
177 | .extra2 = &xfs_params.inherit_nosym.max | 155 | .extra2 = &xfs_params.inherit_nosym.max |
178 | }, | 156 | }, |
179 | { | 157 | { |
180 | .ctl_name = XFS_ROTORSTEP, | ||
181 | .procname = "rotorstep", | 158 | .procname = "rotorstep", |
182 | .data = &xfs_params.rotorstep.val, | 159 | .data = &xfs_params.rotorstep.val, |
183 | .maxlen = sizeof(int), | 160 | .maxlen = sizeof(int), |
184 | .mode = 0644, | 161 | .mode = 0644, |
185 | .proc_handler = &proc_dointvec_minmax, | 162 | .proc_handler = proc_dointvec_minmax, |
186 | .strategy = &sysctl_intvec, | ||
187 | .extra1 = &xfs_params.rotorstep.min, | 163 | .extra1 = &xfs_params.rotorstep.min, |
188 | .extra2 = &xfs_params.rotorstep.max | 164 | .extra2 = &xfs_params.rotorstep.max |
189 | }, | 165 | }, |
190 | { | 166 | { |
191 | .ctl_name = XFS_INHERIT_NODFRG, | ||
192 | .procname = "inherit_nodefrag", | 167 | .procname = "inherit_nodefrag", |
193 | .data = &xfs_params.inherit_nodfrg.val, | 168 | .data = &xfs_params.inherit_nodfrg.val, |
194 | .maxlen = sizeof(int), | 169 | .maxlen = sizeof(int), |
195 | .mode = 0644, | 170 | .mode = 0644, |
196 | .proc_handler = &proc_dointvec_minmax, | 171 | .proc_handler = proc_dointvec_minmax, |
197 | .strategy = &sysctl_intvec, | ||
198 | .extra1 = &xfs_params.inherit_nodfrg.min, | 172 | .extra1 = &xfs_params.inherit_nodfrg.min, |
199 | .extra2 = &xfs_params.inherit_nodfrg.max | 173 | .extra2 = &xfs_params.inherit_nodfrg.max |
200 | }, | 174 | }, |
201 | { | 175 | { |
202 | .ctl_name = XFS_FILESTREAM_TIMER, | ||
203 | .procname = "filestream_centisecs", | 176 | .procname = "filestream_centisecs", |
204 | .data = &xfs_params.fstrm_timer.val, | 177 | .data = &xfs_params.fstrm_timer.val, |
205 | .maxlen = sizeof(int), | 178 | .maxlen = sizeof(int), |
206 | .mode = 0644, | 179 | .mode = 0644, |
207 | .proc_handler = &proc_dointvec_minmax, | 180 | .proc_handler = proc_dointvec_minmax, |
208 | .strategy = &sysctl_intvec, | ||
209 | .extra1 = &xfs_params.fstrm_timer.min, | 181 | .extra1 = &xfs_params.fstrm_timer.min, |
210 | .extra2 = &xfs_params.fstrm_timer.max, | 182 | .extra2 = &xfs_params.fstrm_timer.max, |
211 | }, | 183 | }, |
212 | /* please keep this the last entry */ | 184 | /* please keep this the last entry */ |
213 | #ifdef CONFIG_PROC_FS | 185 | #ifdef CONFIG_PROC_FS |
214 | { | 186 | { |
215 | .ctl_name = XFS_STATS_CLEAR, | ||
216 | .procname = "stats_clear", | 187 | .procname = "stats_clear", |
217 | .data = &xfs_params.stats_clear.val, | 188 | .data = &xfs_params.stats_clear.val, |
218 | .maxlen = sizeof(int), | 189 | .maxlen = sizeof(int), |
219 | .mode = 0644, | 190 | .mode = 0644, |
220 | .proc_handler = &xfs_stats_clear_proc_handler, | 191 | .proc_handler = xfs_stats_clear_proc_handler, |
221 | .strategy = &sysctl_intvec, | ||
222 | .extra1 = &xfs_params.stats_clear.min, | 192 | .extra1 = &xfs_params.stats_clear.min, |
223 | .extra2 = &xfs_params.stats_clear.max | 193 | .extra2 = &xfs_params.stats_clear.max |
224 | }, | 194 | }, |
@@ -229,7 +199,6 @@ static ctl_table xfs_table[] = { | |||
229 | 199 | ||
230 | static ctl_table xfs_dir_table[] = { | 200 | static ctl_table xfs_dir_table[] = { |
231 | { | 201 | { |
232 | .ctl_name = FS_XFS, | ||
233 | .procname = "xfs", | 202 | .procname = "xfs", |
234 | .mode = 0555, | 203 | .mode = 0555, |
235 | .child = xfs_table | 204 | .child = xfs_table |
@@ -239,7 +208,6 @@ static ctl_table xfs_dir_table[] = { | |||
239 | 208 | ||
240 | static ctl_table xfs_root_table[] = { | 209 | static ctl_table xfs_root_table[] = { |
241 | { | 210 | { |
242 | .ctl_name = CTL_FS, | ||
243 | .procname = "fs", | 211 | .procname = "fs", |
244 | .mode = 0555, | 212 | .mode = 0555, |
245 | .child = xfs_dir_table | 213 | .child = xfs_dir_table |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 1e4743ee6831..c83a86a22381 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -15,9 +15,6 @@ | |||
15 | ** The kernel will then return -ENOTDIR to any application using | 15 | ** The kernel will then return -ENOTDIR to any application using |
16 | ** the old binary interface. | 16 | ** the old binary interface. |
17 | ** | 17 | ** |
18 | ** For new interfaces unless you really need a binary number | ||
19 | ** please use CTL_UNNUMBERED. | ||
20 | ** | ||
21 | **************************************************************** | 18 | **************************************************************** |
22 | **************************************************************** | 19 | **************************************************************** |
23 | */ | 20 | */ |
@@ -50,12 +47,6 @@ struct __sysctl_args { | |||
50 | 47 | ||
51 | /* Top-level names: */ | 48 | /* Top-level names: */ |
52 | 49 | ||
53 | /* For internal pattern-matching use only: */ | ||
54 | #ifdef __KERNEL__ | ||
55 | #define CTL_NONE 0 | ||
56 | #define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */ | ||
57 | #endif | ||
58 | |||
59 | enum | 50 | enum |
60 | { | 51 | { |
61 | CTL_KERN=1, /* General kernel info and control */ | 52 | CTL_KERN=1, /* General kernel info and control */ |
@@ -972,10 +963,6 @@ extern int sysctl_perm(struct ctl_table_root *root, | |||
972 | 963 | ||
973 | typedef struct ctl_table ctl_table; | 964 | typedef struct ctl_table ctl_table; |
974 | 965 | ||
975 | typedef int ctl_handler (struct ctl_table *table, | ||
976 | void __user *oldval, size_t __user *oldlenp, | ||
977 | void __user *newval, size_t newlen); | ||
978 | |||
979 | typedef int proc_handler (struct ctl_table *ctl, int write, | 966 | typedef int proc_handler (struct ctl_table *ctl, int write, |
980 | void __user *buffer, size_t *lenp, loff_t *ppos); | 967 | void __user *buffer, size_t *lenp, loff_t *ppos); |
981 | 968 | ||
@@ -996,21 +983,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int, | |||
996 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, | 983 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
997 | void __user *, size_t *, loff_t *); | 984 | void __user *, size_t *, loff_t *); |
998 | 985 | ||
999 | extern int do_sysctl (int __user *name, int nlen, | ||
1000 | void __user *oldval, size_t __user *oldlenp, | ||
1001 | void __user *newval, size_t newlen); | ||
1002 | |||
1003 | extern ctl_handler sysctl_data; | ||
1004 | extern ctl_handler sysctl_string; | ||
1005 | extern ctl_handler sysctl_intvec; | ||
1006 | extern ctl_handler sysctl_jiffies; | ||
1007 | extern ctl_handler sysctl_ms_jiffies; | ||
1008 | |||
1009 | |||
1010 | /* | 986 | /* |
1011 | * Register a set of sysctl names by calling register_sysctl_table | 987 | * Register a set of sysctl names by calling register_sysctl_table |
1012 | * with an initialised array of struct ctl_table's. An entry with zero | 988 | * with an initialised array of struct ctl_table's. An entry with |
1013 | * ctl_name and NULL procname terminates the table. table->de will be | 989 | * NULL procname terminates the table. table->de will be |
1014 | * set up by the registration and need not be initialised in advance. | 990 | * set up by the registration and need not be initialised in advance. |
1015 | * | 991 | * |
1016 | * sysctl names can be mirrored automatically under /proc/sys. The | 992 | * sysctl names can be mirrored automatically under /proc/sys. The |
@@ -1023,24 +999,11 @@ extern ctl_handler sysctl_ms_jiffies; | |||
1023 | * under /proc; non-leaf nodes will be represented by directories. A | 999 | * under /proc; non-leaf nodes will be represented by directories. A |
1024 | * null procname disables /proc mirroring at this node. | 1000 | * null procname disables /proc mirroring at this node. |
1025 | * | 1001 | * |
1026 | * sysctl entries with a zero ctl_name will not be available through | ||
1027 | * the binary sysctl interface. | ||
1028 | * | ||
1029 | * sysctl(2) can automatically manage read and write requests through | 1002 | * sysctl(2) can automatically manage read and write requests through |
1030 | * the sysctl table. The data and maxlen fields of the ctl_table | 1003 | * the sysctl table. The data and maxlen fields of the ctl_table |
1031 | * struct enable minimal validation of the values being written to be | 1004 | * struct enable minimal validation of the values being written to be |
1032 | * performed, and the mode field allows minimal authentication. | 1005 | * performed, and the mode field allows minimal authentication. |
1033 | * | 1006 | * |
1034 | * More sophisticated management can be enabled by the provision of a | ||
1035 | * strategy routine with the table entry. This will be called before | ||
1036 | * any automatic read or write of the data is performed. | ||
1037 | * | ||
1038 | * The strategy routine may return: | ||
1039 | * <0: Error occurred (error is passed to user process) | ||
1040 | * 0: OK - proceed with automatic read or write. | ||
1041 | * >0: OK - read or write has been done by the strategy routine, so | ||
1042 | * return immediately. | ||
1043 | * | ||
1044 | * There must be a proc_handler routine for any terminal nodes | 1007 | * There must be a proc_handler routine for any terminal nodes |
1045 | * mirrored under /proc/sys (non-terminals are handled by a built-in | 1008 | * mirrored under /proc/sys (non-terminals are handled by a built-in |
1046 | * directory handler). Several default handlers are available to | 1009 | * directory handler). Several default handlers are available to |
@@ -1050,7 +1013,6 @@ extern ctl_handler sysctl_ms_jiffies; | |||
1050 | /* A sysctl table is an array of struct ctl_table: */ | 1013 | /* A sysctl table is an array of struct ctl_table: */ |
1051 | struct ctl_table | 1014 | struct ctl_table |
1052 | { | 1015 | { |
1053 | int ctl_name; /* Binary ID */ | ||
1054 | const char *procname; /* Text ID for /proc/sys, or zero */ | 1016 | const char *procname; /* Text ID for /proc/sys, or zero */ |
1055 | void *data; | 1017 | void *data; |
1056 | int maxlen; | 1018 | int maxlen; |
@@ -1058,7 +1020,6 @@ struct ctl_table | |||
1058 | struct ctl_table *child; | 1020 | struct ctl_table *child; |
1059 | struct ctl_table *parent; /* Automatically set */ | 1021 | struct ctl_table *parent; /* Automatically set */ |
1060 | proc_handler *proc_handler; /* Callback for text formatting */ | 1022 | proc_handler *proc_handler; /* Callback for text formatting */ |
1061 | ctl_handler *strategy; /* Callback function for all r/w */ | ||
1062 | void *extra1; | 1023 | void *extra1; |
1063 | void *extra2; | 1024 | void *extra2; |
1064 | }; | 1025 | }; |
@@ -1092,7 +1053,6 @@ struct ctl_table_header | |||
1092 | /* struct ctl_path describes where in the hierarchy a table is added */ | 1053 | /* struct ctl_path describes where in the hierarchy a table is added */ |
1093 | struct ctl_path { | 1054 | struct ctl_path { |
1094 | const char *procname; | 1055 | const char *procname; |
1095 | int ctl_name; | ||
1096 | }; | 1056 | }; |
1097 | 1057 | ||
1098 | void register_sysctl_root(struct ctl_table_root *root); | 1058 | void register_sysctl_root(struct ctl_table_root *root); |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index cee46821dc53..3f781a4cafbe 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
@@ -75,7 +75,6 @@ struct dn_dev_parms { | |||
75 | unsigned long t3; /* Default value of t3 */ | 75 | unsigned long t3; /* Default value of t3 */ |
76 | int priority; /* Priority to be a router */ | 76 | int priority; /* Priority to be a router */ |
77 | char *name; /* Name for sysctl */ | 77 | char *name; /* Name for sysctl */ |
78 | int ctl_name; /* Index for sysctl */ | ||
79 | int (*up)(struct net_device *); | 78 | int (*up)(struct net_device *); |
80 | void (*down)(struct net_device *); | 79 | void (*down)(struct net_device *); |
81 | void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); | 80 | void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 3817fda82a80..da99fdd63cf5 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -264,8 +264,7 @@ extern int neigh_sysctl_register(struct net_device *dev, | |||
264 | struct neigh_parms *p, | 264 | struct neigh_parms *p, |
265 | int p_id, int pdev_id, | 265 | int p_id, int pdev_id, |
266 | char *p_name, | 266 | char *p_name, |
267 | proc_handler *proc_handler, | 267 | proc_handler *proc_handler); |
268 | ctl_handler *strategy); | ||
269 | extern void neigh_sysctl_unregister(struct neigh_parms *p); | 268 | extern void neigh_sysctl_unregister(struct neigh_parms *p); |
270 | 269 | ||
271 | static inline void __neigh_parms_put(struct neigh_parms *parms) | 270 | static inline void __neigh_parms_put(struct neigh_parms *parms) |
diff --git a/init/Kconfig b/init/Kconfig index 9ee778294756..38899243213d 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -763,6 +763,7 @@ config UID16 | |||
763 | 763 | ||
764 | config SYSCTL_SYSCALL | 764 | config SYSCTL_SYSCALL |
765 | bool "Sysctl syscall support" if EMBEDDED | 765 | bool "Sysctl syscall support" if EMBEDDED |
766 | depends on PROC_SYSCTL | ||
766 | default y | 767 | default y |
767 | select SYSCTL | 768 | select SYSCTL |
768 | ---help--- | 769 | ---help--- |
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 7d3704750efc..56410faa4550 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c | |||
@@ -129,136 +129,60 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, | |||
129 | #define proc_ipcauto_dointvec_minmax NULL | 129 | #define proc_ipcauto_dointvec_minmax NULL |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
133 | /* The generic sysctl ipc data routine. */ | ||
134 | static int sysctl_ipc_data(ctl_table *table, | ||
135 | void __user *oldval, size_t __user *oldlenp, | ||
136 | void __user *newval, size_t newlen) | ||
137 | { | ||
138 | size_t len; | ||
139 | void *data; | ||
140 | |||
141 | /* Get out of I don't have a variable */ | ||
142 | if (!table->data || !table->maxlen) | ||
143 | return -ENOTDIR; | ||
144 | |||
145 | data = get_ipc(table); | ||
146 | if (!data) | ||
147 | return -ENOTDIR; | ||
148 | |||
149 | if (oldval && oldlenp) { | ||
150 | if (get_user(len, oldlenp)) | ||
151 | return -EFAULT; | ||
152 | if (len) { | ||
153 | if (len > table->maxlen) | ||
154 | len = table->maxlen; | ||
155 | if (copy_to_user(oldval, data, len)) | ||
156 | return -EFAULT; | ||
157 | if (put_user(len, oldlenp)) | ||
158 | return -EFAULT; | ||
159 | } | ||
160 | } | ||
161 | |||
162 | if (newval && newlen) { | ||
163 | if (newlen > table->maxlen) | ||
164 | newlen = table->maxlen; | ||
165 | |||
166 | if (copy_from_user(data, newval, newlen)) | ||
167 | return -EFAULT; | ||
168 | } | ||
169 | return 1; | ||
170 | } | ||
171 | |||
172 | static int sysctl_ipc_registered_data(ctl_table *table, | ||
173 | void __user *oldval, size_t __user *oldlenp, | ||
174 | void __user *newval, size_t newlen) | ||
175 | { | ||
176 | int rc; | ||
177 | |||
178 | rc = sysctl_ipc_data(table, oldval, oldlenp, newval, newlen); | ||
179 | |||
180 | if (newval && newlen && rc > 0) | ||
181 | /* | ||
182 | * Tunable has successfully been changed from userland | ||
183 | */ | ||
184 | unregister_ipcns_notifier(current->nsproxy->ipc_ns); | ||
185 | |||
186 | return rc; | ||
187 | } | ||
188 | #else | ||
189 | #define sysctl_ipc_data NULL | ||
190 | #define sysctl_ipc_registered_data NULL | ||
191 | #endif | ||
192 | |||
193 | static int zero; | 132 | static int zero; |
194 | static int one = 1; | 133 | static int one = 1; |
195 | 134 | ||
196 | static struct ctl_table ipc_kern_table[] = { | 135 | static struct ctl_table ipc_kern_table[] = { |
197 | { | 136 | { |
198 | .ctl_name = KERN_SHMMAX, | ||
199 | .procname = "shmmax", | 137 | .procname = "shmmax", |
200 | .data = &init_ipc_ns.shm_ctlmax, | 138 | .data = &init_ipc_ns.shm_ctlmax, |
201 | .maxlen = sizeof (init_ipc_ns.shm_ctlmax), | 139 | .maxlen = sizeof (init_ipc_ns.shm_ctlmax), |
202 | .mode = 0644, | 140 | .mode = 0644, |
203 | .proc_handler = proc_ipc_doulongvec_minmax, | 141 | .proc_handler = proc_ipc_doulongvec_minmax, |
204 | .strategy = sysctl_ipc_data, | ||
205 | }, | 142 | }, |
206 | { | 143 | { |
207 | .ctl_name = KERN_SHMALL, | ||
208 | .procname = "shmall", | 144 | .procname = "shmall", |
209 | .data = &init_ipc_ns.shm_ctlall, | 145 | .data = &init_ipc_ns.shm_ctlall, |
210 | .maxlen = sizeof (init_ipc_ns.shm_ctlall), | 146 | .maxlen = sizeof (init_ipc_ns.shm_ctlall), |
211 | .mode = 0644, | 147 | .mode = 0644, |
212 | .proc_handler = proc_ipc_doulongvec_minmax, | 148 | .proc_handler = proc_ipc_doulongvec_minmax, |
213 | .strategy = sysctl_ipc_data, | ||
214 | }, | 149 | }, |
215 | { | 150 | { |
216 | .ctl_name = KERN_SHMMNI, | ||
217 | .procname = "shmmni", | 151 | .procname = "shmmni", |
218 | .data = &init_ipc_ns.shm_ctlmni, | 152 | .data = &init_ipc_ns.shm_ctlmni, |
219 | .maxlen = sizeof (init_ipc_ns.shm_ctlmni), | 153 | .maxlen = sizeof (init_ipc_ns.shm_ctlmni), |
220 | .mode = 0644, | 154 | .mode = 0644, |
221 | .proc_handler = proc_ipc_dointvec, | 155 | .proc_handler = proc_ipc_dointvec, |
222 | .strategy = sysctl_ipc_data, | ||
223 | }, | 156 | }, |
224 | { | 157 | { |
225 | .ctl_name = KERN_MSGMAX, | ||
226 | .procname = "msgmax", | 158 | .procname = "msgmax", |
227 | .data = &init_ipc_ns.msg_ctlmax, | 159 | .data = &init_ipc_ns.msg_ctlmax, |
228 | .maxlen = sizeof (init_ipc_ns.msg_ctlmax), | 160 | .maxlen = sizeof (init_ipc_ns.msg_ctlmax), |
229 | .mode = 0644, | 161 | .mode = 0644, |
230 | .proc_handler = proc_ipc_dointvec, | 162 | .proc_handler = proc_ipc_dointvec, |
231 | .strategy = sysctl_ipc_data, | ||
232 | }, | 163 | }, |
233 | { | 164 | { |
234 | .ctl_name = KERN_MSGMNI, | ||
235 | .procname = "msgmni", | 165 | .procname = "msgmni", |
236 | .data = &init_ipc_ns.msg_ctlmni, | 166 | .data = &init_ipc_ns.msg_ctlmni, |
237 | .maxlen = sizeof (init_ipc_ns.msg_ctlmni), | 167 | .maxlen = sizeof (init_ipc_ns.msg_ctlmni), |
238 | .mode = 0644, | 168 | .mode = 0644, |
239 | .proc_handler = proc_ipc_callback_dointvec, | 169 | .proc_handler = proc_ipc_callback_dointvec, |
240 | .strategy = sysctl_ipc_registered_data, | ||
241 | }, | 170 | }, |
242 | { | 171 | { |
243 | .ctl_name = KERN_MSGMNB, | ||
244 | .procname = "msgmnb", | 172 | .procname = "msgmnb", |
245 | .data = &init_ipc_ns.msg_ctlmnb, | 173 | .data = &init_ipc_ns.msg_ctlmnb, |
246 | .maxlen = sizeof (init_ipc_ns.msg_ctlmnb), | 174 | .maxlen = sizeof (init_ipc_ns.msg_ctlmnb), |
247 | .mode = 0644, | 175 | .mode = 0644, |
248 | .proc_handler = proc_ipc_dointvec, | 176 | .proc_handler = proc_ipc_dointvec, |
249 | .strategy = sysctl_ipc_data, | ||
250 | }, | 177 | }, |
251 | { | 178 | { |
252 | .ctl_name = KERN_SEM, | ||
253 | .procname = "sem", | 179 | .procname = "sem", |
254 | .data = &init_ipc_ns.sem_ctls, | 180 | .data = &init_ipc_ns.sem_ctls, |
255 | .maxlen = 4*sizeof (int), | 181 | .maxlen = 4*sizeof (int), |
256 | .mode = 0644, | 182 | .mode = 0644, |
257 | .proc_handler = proc_ipc_dointvec, | 183 | .proc_handler = proc_ipc_dointvec, |
258 | .strategy = sysctl_ipc_data, | ||
259 | }, | 184 | }, |
260 | { | 185 | { |
261 | .ctl_name = CTL_UNNUMBERED, | ||
262 | .procname = "auto_msgmni", | 186 | .procname = "auto_msgmni", |
263 | .data = &init_ipc_ns.auto_msgmni, | 187 | .data = &init_ipc_ns.auto_msgmni, |
264 | .maxlen = sizeof(int), | 188 | .maxlen = sizeof(int), |
@@ -272,7 +196,6 @@ static struct ctl_table ipc_kern_table[] = { | |||
272 | 196 | ||
273 | static struct ctl_table ipc_root_table[] = { | 197 | static struct ctl_table ipc_root_table[] = { |
274 | { | 198 | { |
275 | .ctl_name = CTL_KERN, | ||
276 | .procname = "kernel", | 199 | .procname = "kernel", |
277 | .mode = 0555, | 200 | .mode = 0555, |
278 | .child = ipc_kern_table, | 201 | .child = ipc_kern_table, |
diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c index 8a058711fc10..0c09366b96f3 100644 --- a/ipc/mq_sysctl.c +++ b/ipc/mq_sysctl.c | |||
@@ -88,7 +88,7 @@ static ctl_table mq_sysctls[] = { | |||
88 | .extra1 = &msg_maxsize_limit_min, | 88 | .extra1 = &msg_maxsize_limit_min, |
89 | .extra2 = &msg_maxsize_limit_max, | 89 | .extra2 = &msg_maxsize_limit_max, |
90 | }, | 90 | }, |
91 | { .ctl_name = 0 } | 91 | {} |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static ctl_table mq_sysctl_dir[] = { | 94 | static ctl_table mq_sysctl_dir[] = { |
@@ -97,17 +97,16 @@ static ctl_table mq_sysctl_dir[] = { | |||
97 | .mode = 0555, | 97 | .mode = 0555, |
98 | .child = mq_sysctls, | 98 | .child = mq_sysctls, |
99 | }, | 99 | }, |
100 | { .ctl_name = 0 } | 100 | {} |
101 | }; | 101 | }; |
102 | 102 | ||
103 | static ctl_table mq_sysctl_root[] = { | 103 | static ctl_table mq_sysctl_root[] = { |
104 | { | 104 | { |
105 | .ctl_name = CTL_FS, | ||
106 | .procname = "fs", | 105 | .procname = "fs", |
107 | .mode = 0555, | 106 | .mode = 0555, |
108 | .child = mq_sysctl_dir, | 107 | .child = mq_sysctl_dir, |
109 | }, | 108 | }, |
110 | { .ctl_name = 0 } | 109 | {} |
111 | }; | 110 | }; |
112 | 111 | ||
113 | struct ctl_table_header *mq_register_sysctl_table(void) | 112 | struct ctl_table_header *mq_register_sysctl_table(void) |
diff --git a/kernel/Makefile b/kernel/Makefile index 982c50e2ce53..9943202b4355 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ | 5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ |
6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ | 6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ |
7 | sysctl.o capability.o ptrace.o timer.o user.o \ | 7 | sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \ |
8 | signal.o sys.o kmod.o workqueue.o pid.o \ | 8 | signal.o sys.o kmod.o workqueue.o pid.o \ |
9 | rcupdate.o extable.o params.o posix-timers.o \ | 9 | rcupdate.o extable.o params.o posix-timers.o \ |
10 | kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ | 10 | kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ |
diff --git a/kernel/sched.c b/kernel/sched.c index aa31244caa9f..e7f2cfa6a257 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -7444,17 +7444,16 @@ static struct ctl_table sd_ctl_dir[] = { | |||
7444 | .procname = "sched_domain", | 7444 | .procname = "sched_domain", |
7445 | .mode = 0555, | 7445 | .mode = 0555, |
7446 | }, | 7446 | }, |
7447 | {0, }, | 7447 | {} |
7448 | }; | 7448 | }; |
7449 | 7449 | ||
7450 | static struct ctl_table sd_ctl_root[] = { | 7450 | static struct ctl_table sd_ctl_root[] = { |
7451 | { | 7451 | { |
7452 | .ctl_name = CTL_KERN, | ||
7453 | .procname = "kernel", | 7452 | .procname = "kernel", |
7454 | .mode = 0555, | 7453 | .mode = 0555, |
7455 | .child = sd_ctl_dir, | 7454 | .child = sd_ctl_dir, |
7456 | }, | 7455 | }, |
7457 | {0, }, | 7456 | {} |
7458 | }; | 7457 | }; |
7459 | 7458 | ||
7460 | static struct ctl_table *sd_alloc_ctl_entry(int n) | 7459 | static struct ctl_table *sd_alloc_ctl_entry(int n) |
diff --git a/kernel/slow-work.c b/kernel/slow-work.c index 00889bd3c590..7494bbf5a270 100644 --- a/kernel/slow-work.c +++ b/kernel/slow-work.c | |||
@@ -49,7 +49,6 @@ static const int slow_work_max_vslow = 99; | |||
49 | 49 | ||
50 | ctl_table slow_work_sysctls[] = { | 50 | ctl_table slow_work_sysctls[] = { |
51 | { | 51 | { |
52 | .ctl_name = CTL_UNNUMBERED, | ||
53 | .procname = "min-threads", | 52 | .procname = "min-threads", |
54 | .data = &slow_work_min_threads, | 53 | .data = &slow_work_min_threads, |
55 | .maxlen = sizeof(unsigned), | 54 | .maxlen = sizeof(unsigned), |
@@ -59,7 +58,6 @@ ctl_table slow_work_sysctls[] = { | |||
59 | .extra2 = &slow_work_max_threads, | 58 | .extra2 = &slow_work_max_threads, |
60 | }, | 59 | }, |
61 | { | 60 | { |
62 | .ctl_name = CTL_UNNUMBERED, | ||
63 | .procname = "max-threads", | 61 | .procname = "max-threads", |
64 | .data = &slow_work_max_threads, | 62 | .data = &slow_work_max_threads, |
65 | .maxlen = sizeof(unsigned), | 63 | .maxlen = sizeof(unsigned), |
@@ -69,16 +67,15 @@ ctl_table slow_work_sysctls[] = { | |||
69 | .extra2 = (void *) &slow_work_max_max_threads, | 67 | .extra2 = (void *) &slow_work_max_max_threads, |
70 | }, | 68 | }, |
71 | { | 69 | { |
72 | .ctl_name = CTL_UNNUMBERED, | ||
73 | .procname = "vslow-percentage", | 70 | .procname = "vslow-percentage", |
74 | .data = &vslow_work_proportion, | 71 | .data = &vslow_work_proportion, |
75 | .maxlen = sizeof(unsigned), | 72 | .maxlen = sizeof(unsigned), |
76 | .mode = 0644, | 73 | .mode = 0644, |
77 | .proc_handler = &proc_dointvec_minmax, | 74 | .proc_handler = proc_dointvec_minmax, |
78 | .extra1 = (void *) &slow_work_min_vslow, | 75 | .extra1 = (void *) &slow_work_min_vslow, |
79 | .extra2 = (void *) &slow_work_max_vslow, | 76 | .extra2 = (void *) &slow_work_max_vslow, |
80 | }, | 77 | }, |
81 | { .ctl_name = 0 } | 78 | {} |
82 | }; | 79 | }; |
83 | #endif | 80 | #endif |
84 | 81 | ||
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index e06d0b8d1951..de5bf1448238 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -139,7 +139,6 @@ cond_syscall(sys_pciconfig_read); | |||
139 | cond_syscall(sys_pciconfig_write); | 139 | cond_syscall(sys_pciconfig_write); |
140 | cond_syscall(sys_pciconfig_iobase); | 140 | cond_syscall(sys_pciconfig_iobase); |
141 | cond_syscall(sys32_ipc); | 141 | cond_syscall(sys32_ipc); |
142 | cond_syscall(sys32_sysctl); | ||
143 | cond_syscall(ppc_rtas); | 142 | cond_syscall(ppc_rtas); |
144 | cond_syscall(sys_spu_run); | 143 | cond_syscall(sys_spu_run); |
145 | cond_syscall(sys_spu_create); | 144 | cond_syscall(sys_spu_create); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 4dbf93a52ee9..9327a26765c5 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/security.h> | 27 | #include <linux/security.h> |
28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
29 | #include <linux/kmemcheck.h> | 29 | #include <linux/kmemcheck.h> |
30 | #include <linux/smp_lock.h> | ||
31 | #include <linux/fs.h> | 30 | #include <linux/fs.h> |
32 | #include <linux/init.h> | 31 | #include <linux/init.h> |
33 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
@@ -61,7 +60,6 @@ | |||
61 | #include <asm/io.h> | 60 | #include <asm/io.h> |
62 | #endif | 61 | #endif |
63 | 62 | ||
64 | static int deprecated_sysctl_warning(struct __sysctl_args *args); | ||
65 | 63 | ||
66 | #if defined(CONFIG_SYSCTL) | 64 | #if defined(CONFIG_SYSCTL) |
67 | 65 | ||
@@ -210,31 +208,26 @@ extern int lock_stat; | |||
210 | 208 | ||
211 | static struct ctl_table root_table[] = { | 209 | static struct ctl_table root_table[] = { |
212 | { | 210 | { |
213 | .ctl_name = CTL_KERN, | ||
214 | .procname = "kernel", | 211 | .procname = "kernel", |
215 | .mode = 0555, | 212 | .mode = 0555, |
216 | .child = kern_table, | 213 | .child = kern_table, |
217 | }, | 214 | }, |
218 | { | 215 | { |
219 | .ctl_name = CTL_VM, | ||
220 | .procname = "vm", | 216 | .procname = "vm", |
221 | .mode = 0555, | 217 | .mode = 0555, |
222 | .child = vm_table, | 218 | .child = vm_table, |
223 | }, | 219 | }, |
224 | { | 220 | { |
225 | .ctl_name = CTL_FS, | ||
226 | .procname = "fs", | 221 | .procname = "fs", |
227 | .mode = 0555, | 222 | .mode = 0555, |
228 | .child = fs_table, | 223 | .child = fs_table, |
229 | }, | 224 | }, |
230 | { | 225 | { |
231 | .ctl_name = CTL_DEBUG, | ||
232 | .procname = "debug", | 226 | .procname = "debug", |
233 | .mode = 0555, | 227 | .mode = 0555, |
234 | .child = debug_table, | 228 | .child = debug_table, |
235 | }, | 229 | }, |
236 | { | 230 | { |
237 | .ctl_name = CTL_DEV, | ||
238 | .procname = "dev", | 231 | .procname = "dev", |
239 | .mode = 0555, | 232 | .mode = 0555, |
240 | .child = dev_table, | 233 | .child = dev_table, |
@@ -243,7 +236,7 @@ static struct ctl_table root_table[] = { | |||
243 | * NOTE: do not add new entries to this table unless you have read | 236 | * NOTE: do not add new entries to this table unless you have read |
244 | * Documentation/sysctl/ctl_unnumbered.txt | 237 | * Documentation/sysctl/ctl_unnumbered.txt |
245 | */ | 238 | */ |
246 | { .ctl_name = 0 } | 239 | { } |
247 | }; | 240 | }; |
248 | 241 | ||
249 | #ifdef CONFIG_SCHED_DEBUG | 242 | #ifdef CONFIG_SCHED_DEBUG |
@@ -255,192 +248,166 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |||
255 | 248 | ||
256 | static struct ctl_table kern_table[] = { | 249 | static struct ctl_table kern_table[] = { |
257 | { | 250 | { |
258 | .ctl_name = CTL_UNNUMBERED, | ||
259 | .procname = "sched_child_runs_first", | 251 | .procname = "sched_child_runs_first", |
260 | .data = &sysctl_sched_child_runs_first, | 252 | .data = &sysctl_sched_child_runs_first, |
261 | .maxlen = sizeof(unsigned int), | 253 | .maxlen = sizeof(unsigned int), |
262 | .mode = 0644, | 254 | .mode = 0644, |
263 | .proc_handler = &proc_dointvec, | 255 | .proc_handler = proc_dointvec, |
264 | }, | 256 | }, |
265 | #ifdef CONFIG_SCHED_DEBUG | 257 | #ifdef CONFIG_SCHED_DEBUG |
266 | { | 258 | { |
267 | .ctl_name = CTL_UNNUMBERED, | ||
268 | .procname = "sched_min_granularity_ns", | 259 | .procname = "sched_min_granularity_ns", |
269 | .data = &sysctl_sched_min_granularity, | 260 | .data = &sysctl_sched_min_granularity, |
270 | .maxlen = sizeof(unsigned int), | 261 | .maxlen = sizeof(unsigned int), |
271 | .mode = 0644, | 262 | .mode = 0644, |
272 | .proc_handler = &sched_nr_latency_handler, | 263 | .proc_handler = sched_nr_latency_handler, |
273 | .strategy = &sysctl_intvec, | ||
274 | .extra1 = &min_sched_granularity_ns, | 264 | .extra1 = &min_sched_granularity_ns, |
275 | .extra2 = &max_sched_granularity_ns, | 265 | .extra2 = &max_sched_granularity_ns, |
276 | }, | 266 | }, |
277 | { | 267 | { |
278 | .ctl_name = CTL_UNNUMBERED, | ||
279 | .procname = "sched_latency_ns", | 268 | .procname = "sched_latency_ns", |
280 | .data = &sysctl_sched_latency, | 269 | .data = &sysctl_sched_latency, |
281 | .maxlen = sizeof(unsigned int), | 270 | .maxlen = sizeof(unsigned int), |
282 | .mode = 0644, | 271 | .mode = 0644, |
283 | .proc_handler = &sched_nr_latency_handler, | 272 | .proc_handler = sched_nr_latency_handler, |
284 | .strategy = &sysctl_intvec, | ||
285 | .extra1 = &min_sched_granularity_ns, | 273 | .extra1 = &min_sched_granularity_ns, |
286 | .extra2 = &max_sched_granularity_ns, | 274 | .extra2 = &max_sched_granularity_ns, |
287 | }, | 275 | }, |
288 | { | 276 | { |
289 | .ctl_name = CTL_UNNUMBERED, | ||
290 | .procname = "sched_wakeup_granularity_ns", | 277 | .procname = "sched_wakeup_granularity_ns", |
291 | .data = &sysctl_sched_wakeup_granularity, | 278 | .data = &sysctl_sched_wakeup_granularity, |
292 | .maxlen = sizeof(unsigned int), | 279 | .maxlen = sizeof(unsigned int), |
293 | .mode = 0644, | 280 | .mode = 0644, |
294 | .proc_handler = &proc_dointvec_minmax, | 281 | .proc_handler = proc_dointvec_minmax, |
295 | .strategy = &sysctl_intvec, | ||
296 | .extra1 = &min_wakeup_granularity_ns, | 282 | .extra1 = &min_wakeup_granularity_ns, |
297 | .extra2 = &max_wakeup_granularity_ns, | 283 | .extra2 = &max_wakeup_granularity_ns, |
298 | }, | 284 | }, |
299 | { | 285 | { |
300 | .ctl_name = CTL_UNNUMBERED, | ||
301 | .procname = "sched_shares_ratelimit", | 286 | .procname = "sched_shares_ratelimit", |
302 | .data = &sysctl_sched_shares_ratelimit, | 287 | .data = &sysctl_sched_shares_ratelimit, |
303 | .maxlen = sizeof(unsigned int), | 288 | .maxlen = sizeof(unsigned int), |
304 | .mode = 0644, | 289 | .mode = 0644, |
305 | .proc_handler = &proc_dointvec, | 290 | .proc_handler = proc_dointvec, |
306 | }, | 291 | }, |
307 | { | 292 | { |
308 | .ctl_name = CTL_UNNUMBERED, | ||
309 | .procname = "sched_shares_thresh", | 293 | .procname = "sched_shares_thresh", |
310 | .data = &sysctl_sched_shares_thresh, | 294 | .data = &sysctl_sched_shares_thresh, |
311 | .maxlen = sizeof(unsigned int), | 295 | .maxlen = sizeof(unsigned int), |
312 | .mode = 0644, | 296 | .mode = 0644, |
313 | .proc_handler = &proc_dointvec_minmax, | 297 | .proc_handler = proc_dointvec_minmax, |
314 | .strategy = &sysctl_intvec, | ||
315 | .extra1 = &zero, | 298 | .extra1 = &zero, |
316 | }, | 299 | }, |
317 | { | 300 | { |
318 | .ctl_name = CTL_UNNUMBERED, | ||
319 | .procname = "sched_features", | 301 | .procname = "sched_features", |
320 | .data = &sysctl_sched_features, | 302 | .data = &sysctl_sched_features, |
321 | .maxlen = sizeof(unsigned int), | 303 | .maxlen = sizeof(unsigned int), |
322 | .mode = 0644, | 304 | .mode = 0644, |
323 | .proc_handler = &proc_dointvec, | 305 | .proc_handler = proc_dointvec, |
324 | }, | 306 | }, |
325 | { | 307 | { |
326 | .ctl_name = CTL_UNNUMBERED, | ||
327 | .procname = "sched_migration_cost", | 308 | .procname = "sched_migration_cost", |
328 | .data = &sysctl_sched_migration_cost, | 309 | .data = &sysctl_sched_migration_cost, |
329 | .maxlen = sizeof(unsigned int), | 310 | .maxlen = sizeof(unsigned int), |
330 | .mode = 0644, | 311 | .mode = 0644, |
331 | .proc_handler = &proc_dointvec, | 312 | .proc_handler = proc_dointvec, |
332 | }, | 313 | }, |
333 | { | 314 | { |
334 | .ctl_name = CTL_UNNUMBERED, | ||
335 | .procname = "sched_nr_migrate", | 315 | .procname = "sched_nr_migrate", |
336 | .data = &sysctl_sched_nr_migrate, | 316 | .data = &sysctl_sched_nr_migrate, |
337 | .maxlen = sizeof(unsigned int), | 317 | .maxlen = sizeof(unsigned int), |
338 | .mode = 0644, | 318 | .mode = 0644, |
339 | .proc_handler = &proc_dointvec, | 319 | .proc_handler = proc_dointvec, |
340 | }, | 320 | }, |
341 | { | 321 | { |
342 | .ctl_name = CTL_UNNUMBERED, | ||
343 | .procname = "sched_time_avg", | 322 | .procname = "sched_time_avg", |
344 | .data = &sysctl_sched_time_avg, | 323 | .data = &sysctl_sched_time_avg, |
345 | .maxlen = sizeof(unsigned int), | 324 | .maxlen = sizeof(unsigned int), |
346 | .mode = 0644, | 325 | .mode = 0644, |
347 | .proc_handler = &proc_dointvec, | 326 | .proc_handler = proc_dointvec, |
348 | }, | 327 | }, |
349 | { | 328 | { |
350 | .ctl_name = CTL_UNNUMBERED, | ||
351 | .procname = "timer_migration", | 329 | .procname = "timer_migration", |
352 | .data = &sysctl_timer_migration, | 330 | .data = &sysctl_timer_migration, |
353 | .maxlen = sizeof(unsigned int), | 331 | .maxlen = sizeof(unsigned int), |
354 | .mode = 0644, | 332 | .mode = 0644, |
355 | .proc_handler = &proc_dointvec_minmax, | 333 | .proc_handler = proc_dointvec_minmax, |
356 | .strategy = &sysctl_intvec, | ||
357 | .extra1 = &zero, | 334 | .extra1 = &zero, |
358 | .extra2 = &one, | 335 | .extra2 = &one, |
359 | }, | 336 | }, |
360 | #endif | 337 | #endif |
361 | { | 338 | { |
362 | .ctl_name = CTL_UNNUMBERED, | ||
363 | .procname = "sched_rt_period_us", | 339 | .procname = "sched_rt_period_us", |
364 | .data = &sysctl_sched_rt_period, | 340 | .data = &sysctl_sched_rt_period, |
365 | .maxlen = sizeof(unsigned int), | 341 | .maxlen = sizeof(unsigned int), |
366 | .mode = 0644, | 342 | .mode = 0644, |
367 | .proc_handler = &sched_rt_handler, | 343 | .proc_handler = sched_rt_handler, |
368 | }, | 344 | }, |
369 | { | 345 | { |
370 | .ctl_name = CTL_UNNUMBERED, | ||
371 | .procname = "sched_rt_runtime_us", | 346 | .procname = "sched_rt_runtime_us", |
372 | .data = &sysctl_sched_rt_runtime, | 347 | .data = &sysctl_sched_rt_runtime, |
373 | .maxlen = sizeof(int), | 348 | .maxlen = sizeof(int), |
374 | .mode = 0644, | 349 | .mode = 0644, |
375 | .proc_handler = &sched_rt_handler, | 350 | .proc_handler = sched_rt_handler, |
376 | }, | 351 | }, |
377 | { | 352 | { |
378 | .ctl_name = CTL_UNNUMBERED, | ||
379 | .procname = "sched_compat_yield", | 353 | .procname = "sched_compat_yield", |
380 | .data = &sysctl_sched_compat_yield, | 354 | .data = &sysctl_sched_compat_yield, |
381 | .maxlen = sizeof(unsigned int), | 355 | .maxlen = sizeof(unsigned int), |
382 | .mode = 0644, | 356 | .mode = 0644, |
383 | .proc_handler = &proc_dointvec, | 357 | .proc_handler = proc_dointvec, |
384 | }, | 358 | }, |
385 | #ifdef CONFIG_PROVE_LOCKING | 359 | #ifdef CONFIG_PROVE_LOCKING |
386 | { | 360 | { |
387 | .ctl_name = CTL_UNNUMBERED, | ||
388 | .procname = "prove_locking", | 361 | .procname = "prove_locking", |
389 | .data = &prove_locking, | 362 | .data = &prove_locking, |
390 | .maxlen = sizeof(int), | 363 | .maxlen = sizeof(int), |
391 | .mode = 0644, | 364 | .mode = 0644, |
392 | .proc_handler = &proc_dointvec, | 365 | .proc_handler = proc_dointvec, |
393 | }, | 366 | }, |
394 | #endif | 367 | #endif |
395 | #ifdef CONFIG_LOCK_STAT | 368 | #ifdef CONFIG_LOCK_STAT |
396 | { | 369 | { |
397 | .ctl_name = CTL_UNNUMBERED, | ||
398 | .procname = "lock_stat", | 370 | .procname = "lock_stat", |
399 | .data = &lock_stat, | 371 | .data = &lock_stat, |
400 | .maxlen = sizeof(int), | 372 | .maxlen = sizeof(int), |
401 | .mode = 0644, | 373 | .mode = 0644, |
402 | .proc_handler = &proc_dointvec, | 374 | .proc_handler = proc_dointvec, |
403 | }, | 375 | }, |
404 | #endif | 376 | #endif |
405 | { | 377 | { |
406 | .ctl_name = KERN_PANIC, | ||
407 | .procname = "panic", | 378 | .procname = "panic", |
408 | .data = &panic_timeout, | 379 | .data = &panic_timeout, |
409 | .maxlen = sizeof(int), | 380 | .maxlen = sizeof(int), |
410 | .mode = 0644, | 381 | .mode = 0644, |
411 | .proc_handler = &proc_dointvec, | 382 | .proc_handler = proc_dointvec, |
412 | }, | 383 | }, |
413 | { | 384 | { |
414 | .ctl_name = KERN_CORE_USES_PID, | ||
415 | .procname = "core_uses_pid", | 385 | .procname = "core_uses_pid", |
416 | .data = &core_uses_pid, | 386 | .data = &core_uses_pid, |
417 | .maxlen = sizeof(int), | 387 | .maxlen = sizeof(int), |
418 | .mode = 0644, | 388 | .mode = 0644, |
419 | .proc_handler = &proc_dointvec, | 389 | .proc_handler = proc_dointvec, |
420 | }, | 390 | }, |
421 | { | 391 | { |
422 | .ctl_name = KERN_CORE_PATTERN, | ||
423 | .procname = "core_pattern", | 392 | .procname = "core_pattern", |
424 | .data = core_pattern, | 393 | .data = core_pattern, |
425 | .maxlen = CORENAME_MAX_SIZE, | 394 | .maxlen = CORENAME_MAX_SIZE, |
426 | .mode = 0644, | 395 | .mode = 0644, |
427 | .proc_handler = &proc_dostring, | 396 | .proc_handler = proc_dostring, |
428 | .strategy = &sysctl_string, | ||
429 | }, | 397 | }, |
430 | { | 398 | { |
431 | .ctl_name = CTL_UNNUMBERED, | ||
432 | .procname = "core_pipe_limit", | 399 | .procname = "core_pipe_limit", |
433 | .data = &core_pipe_limit, | 400 | .data = &core_pipe_limit, |
434 | .maxlen = sizeof(unsigned int), | 401 | .maxlen = sizeof(unsigned int), |
435 | .mode = 0644, | 402 | .mode = 0644, |
436 | .proc_handler = &proc_dointvec, | 403 | .proc_handler = proc_dointvec, |
437 | }, | 404 | }, |
438 | #ifdef CONFIG_PROC_SYSCTL | 405 | #ifdef CONFIG_PROC_SYSCTL |
439 | { | 406 | { |
440 | .procname = "tainted", | 407 | .procname = "tainted", |
441 | .maxlen = sizeof(long), | 408 | .maxlen = sizeof(long), |
442 | .mode = 0644, | 409 | .mode = 0644, |
443 | .proc_handler = &proc_taint, | 410 | .proc_handler = proc_taint, |
444 | }, | 411 | }, |
445 | #endif | 412 | #endif |
446 | #ifdef CONFIG_LATENCYTOP | 413 | #ifdef CONFIG_LATENCYTOP |
@@ -449,181 +416,160 @@ static struct ctl_table kern_table[] = { | |||
449 | .data = &latencytop_enabled, | 416 | .data = &latencytop_enabled, |
450 | .maxlen = sizeof(int), | 417 | .maxlen = sizeof(int), |
451 | .mode = 0644, | 418 | .mode = 0644, |
452 | .proc_handler = &proc_dointvec, | 419 | .proc_handler = proc_dointvec, |
453 | }, | 420 | }, |
454 | #endif | 421 | #endif |
455 | #ifdef CONFIG_BLK_DEV_INITRD | 422 | #ifdef CONFIG_BLK_DEV_INITRD |
456 | { | 423 | { |
457 | .ctl_name = KERN_REALROOTDEV, | ||
458 | .procname = "real-root-dev", | 424 | .procname = "real-root-dev", |
459 | .data = &real_root_dev, | 425 | .data = &real_root_dev, |
460 | .maxlen = sizeof(int), | 426 | .maxlen = sizeof(int), |
461 | .mode = 0644, | 427 | .mode = 0644, |
462 | .proc_handler = &proc_dointvec, | 428 | .proc_handler = proc_dointvec, |
463 | }, | 429 | }, |
464 | #endif | 430 | #endif |
465 | { | 431 | { |
466 | .ctl_name = CTL_UNNUMBERED, | ||
467 | .procname = "print-fatal-signals", | 432 | .procname = "print-fatal-signals", |
468 | .data = &print_fatal_signals, | 433 | .data = &print_fatal_signals, |
469 | .maxlen = sizeof(int), | 434 | .maxlen = sizeof(int), |
470 | .mode = 0644, | 435 | .mode = 0644, |
471 | .proc_handler = &proc_dointvec, | 436 | .proc_handler = proc_dointvec, |
472 | }, | 437 | }, |
473 | #ifdef CONFIG_SPARC | 438 | #ifdef CONFIG_SPARC |
474 | { | 439 | { |
475 | .ctl_name = KERN_SPARC_REBOOT, | ||
476 | .procname = "reboot-cmd", | 440 | .procname = "reboot-cmd", |
477 | .data = reboot_command, | 441 | .data = reboot_command, |
478 | .maxlen = 256, | 442 | .maxlen = 256, |
479 | .mode = 0644, | 443 | .mode = 0644, |
480 | .proc_handler = &proc_dostring, | 444 | .proc_handler = proc_dostring, |
481 | .strategy = &sysctl_string, | ||
482 | }, | 445 | }, |
483 | { | 446 | { |
484 | .ctl_name = KERN_SPARC_STOP_A, | ||
485 | .procname = "stop-a", | 447 | .procname = "stop-a", |
486 | .data = &stop_a_enabled, | 448 | .data = &stop_a_enabled, |
487 | .maxlen = sizeof (int), | 449 | .maxlen = sizeof (int), |
488 | .mode = 0644, | 450 | .mode = 0644, |
489 | .proc_handler = &proc_dointvec, | 451 | .proc_handler = proc_dointvec, |
490 | }, | 452 | }, |
491 | { | 453 | { |
492 | .ctl_name = KERN_SPARC_SCONS_PWROFF, | ||
493 | .procname = "scons-poweroff", | 454 | .procname = "scons-poweroff", |
494 | .data = &scons_pwroff, | 455 | .data = &scons_pwroff, |
495 | .maxlen = sizeof (int), | 456 | .maxlen = sizeof (int), |
496 | .mode = 0644, | 457 | .mode = 0644, |
497 | .proc_handler = &proc_dointvec, | 458 | .proc_handler = proc_dointvec, |
498 | }, | 459 | }, |
499 | #endif | 460 | #endif |
500 | #ifdef CONFIG_SPARC64 | 461 | #ifdef CONFIG_SPARC64 |
501 | { | 462 | { |
502 | .ctl_name = CTL_UNNUMBERED, | ||
503 | .procname = "tsb-ratio", | 463 | .procname = "tsb-ratio", |
504 | .data = &sysctl_tsb_ratio, | 464 | .data = &sysctl_tsb_ratio, |
505 | .maxlen = sizeof (int), | 465 | .maxlen = sizeof (int), |
506 | .mode = 0644, | 466 | .mode = 0644, |
507 | .proc_handler = &proc_dointvec, | 467 | .proc_handler = proc_dointvec, |
508 | }, | 468 | }, |
509 | #endif | 469 | #endif |
510 | #ifdef __hppa__ | 470 | #ifdef __hppa__ |
511 | { | 471 | { |
512 | .ctl_name = KERN_HPPA_PWRSW, | ||
513 | .procname = "soft-power", | 472 | .procname = "soft-power", |
514 | .data = &pwrsw_enabled, | 473 | .data = &pwrsw_enabled, |
515 | .maxlen = sizeof (int), | 474 | .maxlen = sizeof (int), |
516 | .mode = 0644, | 475 | .mode = 0644, |
517 | .proc_handler = &proc_dointvec, | 476 | .proc_handler = proc_dointvec, |
518 | }, | 477 | }, |
519 | { | 478 | { |
520 | .ctl_name = KERN_HPPA_UNALIGNED, | ||
521 | .procname = "unaligned-trap", | 479 | .procname = "unaligned-trap", |
522 | .data = &unaligned_enabled, | 480 | .data = &unaligned_enabled, |
523 | .maxlen = sizeof (int), | 481 | .maxlen = sizeof (int), |
524 | .mode = 0644, | 482 | .mode = 0644, |
525 | .proc_handler = &proc_dointvec, | 483 | .proc_handler = proc_dointvec, |
526 | }, | 484 | }, |
527 | #endif | 485 | #endif |
528 | { | 486 | { |
529 | .ctl_name = KERN_CTLALTDEL, | ||
530 | .procname = "ctrl-alt-del", | 487 | .procname = "ctrl-alt-del", |
531 | .data = &C_A_D, | 488 | .data = &C_A_D, |
532 | .maxlen = sizeof(int), | 489 | .maxlen = sizeof(int), |
533 | .mode = 0644, | 490 | .mode = 0644, |
534 | .proc_handler = &proc_dointvec, | 491 | .proc_handler = proc_dointvec, |
535 | }, | 492 | }, |
536 | #ifdef CONFIG_FUNCTION_TRACER | 493 | #ifdef CONFIG_FUNCTION_TRACER |
537 | { | 494 | { |
538 | .ctl_name = CTL_UNNUMBERED, | ||
539 | .procname = "ftrace_enabled", | 495 | .procname = "ftrace_enabled", |
540 | .data = &ftrace_enabled, | 496 | .data = &ftrace_enabled, |
541 | .maxlen = sizeof(int), | 497 | .maxlen = sizeof(int), |
542 | .mode = 0644, | 498 | .mode = 0644, |
543 | .proc_handler = &ftrace_enable_sysctl, | 499 | .proc_handler = ftrace_enable_sysctl, |
544 | }, | 500 | }, |
545 | #endif | 501 | #endif |
546 | #ifdef CONFIG_STACK_TRACER | 502 | #ifdef CONFIG_STACK_TRACER |
547 | { | 503 | { |
548 | .ctl_name = CTL_UNNUMBERED, | ||
549 | .procname = "stack_tracer_enabled", | 504 | .procname = "stack_tracer_enabled", |
550 | .data = &stack_tracer_enabled, | 505 | .data = &stack_tracer_enabled, |
551 | .maxlen = sizeof(int), | 506 | .maxlen = sizeof(int), |
552 | .mode = 0644, | 507 | .mode = 0644, |
553 | .proc_handler = &stack_trace_sysctl, | 508 | .proc_handler = stack_trace_sysctl, |
554 | }, | 509 | }, |
555 | #endif | 510 | #endif |
556 | #ifdef CONFIG_TRACING | 511 | #ifdef CONFIG_TRACING |
557 | { | 512 | { |
558 | .ctl_name = CTL_UNNUMBERED, | ||
559 | .procname = "ftrace_dump_on_oops", | 513 | .procname = "ftrace_dump_on_oops", |
560 | .data = &ftrace_dump_on_oops, | 514 | .data = &ftrace_dump_on_oops, |
561 | .maxlen = sizeof(int), | 515 | .maxlen = sizeof(int), |
562 | .mode = 0644, | 516 | .mode = 0644, |
563 | .proc_handler = &proc_dointvec, | 517 | .proc_handler = proc_dointvec, |
564 | }, | 518 | }, |
565 | #endif | 519 | #endif |
566 | #ifdef CONFIG_MODULES | 520 | #ifdef CONFIG_MODULES |
567 | { | 521 | { |
568 | .ctl_name = KERN_MODPROBE, | ||
569 | .procname = "modprobe", | 522 | .procname = "modprobe", |
570 | .data = &modprobe_path, | 523 | .data = &modprobe_path, |
571 | .maxlen = KMOD_PATH_LEN, | 524 | .maxlen = KMOD_PATH_LEN, |
572 | .mode = 0644, | 525 | .mode = 0644, |
573 | .proc_handler = &proc_dostring, | 526 | .proc_handler = proc_dostring, |
574 | .strategy = &sysctl_string, | ||
575 | }, | 527 | }, |
576 | { | 528 | { |
577 | .ctl_name = CTL_UNNUMBERED, | ||
578 | .procname = "modules_disabled", | 529 | .procname = "modules_disabled", |
579 | .data = &modules_disabled, | 530 | .data = &modules_disabled, |
580 | .maxlen = sizeof(int), | 531 | .maxlen = sizeof(int), |
581 | .mode = 0644, | 532 | .mode = 0644, |
582 | /* only handle a transition from default "0" to "1" */ | 533 | /* only handle a transition from default "0" to "1" */ |
583 | .proc_handler = &proc_dointvec_minmax, | 534 | .proc_handler = proc_dointvec_minmax, |
584 | .extra1 = &one, | 535 | .extra1 = &one, |
585 | .extra2 = &one, | 536 | .extra2 = &one, |
586 | }, | 537 | }, |
587 | #endif | 538 | #endif |
588 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 539 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
589 | { | 540 | { |
590 | .ctl_name = KERN_HOTPLUG, | ||
591 | .procname = "hotplug", | 541 | .procname = "hotplug", |
592 | .data = &uevent_helper, | 542 | .data = &uevent_helper, |
593 | .maxlen = UEVENT_HELPER_PATH_LEN, | 543 | .maxlen = UEVENT_HELPER_PATH_LEN, |
594 | .mode = 0644, | 544 | .mode = 0644, |
595 | .proc_handler = &proc_dostring, | 545 | .proc_handler = proc_dostring, |
596 | .strategy = &sysctl_string, | ||
597 | }, | 546 | }, |
598 | #endif | 547 | #endif |
599 | #ifdef CONFIG_CHR_DEV_SG | 548 | #ifdef CONFIG_CHR_DEV_SG |
600 | { | 549 | { |
601 | .ctl_name = KERN_SG_BIG_BUFF, | ||
602 | .procname = "sg-big-buff", | 550 | .procname = "sg-big-buff", |
603 | .data = &sg_big_buff, | 551 | .data = &sg_big_buff, |
604 | .maxlen = sizeof (int), | 552 | .maxlen = sizeof (int), |
605 | .mode = 0444, | 553 | .mode = 0444, |
606 | .proc_handler = &proc_dointvec, | 554 | .proc_handler = proc_dointvec, |
607 | }, | 555 | }, |
608 | #endif | 556 | #endif |
609 | #ifdef CONFIG_BSD_PROCESS_ACCT | 557 | #ifdef CONFIG_BSD_PROCESS_ACCT |
610 | { | 558 | { |
611 | .ctl_name = KERN_ACCT, | ||
612 | .procname = "acct", | 559 | .procname = "acct", |
613 | .data = &acct_parm, | 560 | .data = &acct_parm, |
614 | .maxlen = 3*sizeof(int), | 561 | .maxlen = 3*sizeof(int), |
615 | .mode = 0644, | 562 | .mode = 0644, |
616 | .proc_handler = &proc_dointvec, | 563 | .proc_handler = proc_dointvec, |
617 | }, | 564 | }, |
618 | #endif | 565 | #endif |
619 | #ifdef CONFIG_MAGIC_SYSRQ | 566 | #ifdef CONFIG_MAGIC_SYSRQ |
620 | { | 567 | { |
621 | .ctl_name = KERN_SYSRQ, | ||
622 | .procname = "sysrq", | 568 | .procname = "sysrq", |
623 | .data = &__sysrq_enabled, | 569 | .data = &__sysrq_enabled, |
624 | .maxlen = sizeof (int), | 570 | .maxlen = sizeof (int), |
625 | .mode = 0644, | 571 | .mode = 0644, |
626 | .proc_handler = &proc_dointvec, | 572 | .proc_handler = proc_dointvec, |
627 | }, | 573 | }, |
628 | #endif | 574 | #endif |
629 | #ifdef CONFIG_PROC_SYSCTL | 575 | #ifdef CONFIG_PROC_SYSCTL |
@@ -632,215 +578,188 @@ static struct ctl_table kern_table[] = { | |||
632 | .data = NULL, | 578 | .data = NULL, |
633 | .maxlen = sizeof (int), | 579 | .maxlen = sizeof (int), |
634 | .mode = 0600, | 580 | .mode = 0600, |
635 | .proc_handler = &proc_do_cad_pid, | 581 | .proc_handler = proc_do_cad_pid, |
636 | }, | 582 | }, |
637 | #endif | 583 | #endif |
638 | { | 584 | { |
639 | .ctl_name = KERN_MAX_THREADS, | ||
640 | .procname = "threads-max", | 585 | .procname = "threads-max", |
641 | .data = &max_threads, | 586 | .data = &max_threads, |
642 | .maxlen = sizeof(int), | 587 | .maxlen = sizeof(int), |
643 | .mode = 0644, | 588 | .mode = 0644, |
644 | .proc_handler = &proc_dointvec, | 589 | .proc_handler = proc_dointvec, |
645 | }, | 590 | }, |
646 | { | 591 | { |
647 | .ctl_name = KERN_RANDOM, | ||
648 | .procname = "random", | 592 | .procname = "random", |
649 | .mode = 0555, | 593 | .mode = 0555, |
650 | .child = random_table, | 594 | .child = random_table, |
651 | }, | 595 | }, |
652 | { | 596 | { |
653 | .ctl_name = KERN_OVERFLOWUID, | ||
654 | .procname = "overflowuid", | 597 | .procname = "overflowuid", |
655 | .data = &overflowuid, | 598 | .data = &overflowuid, |
656 | .maxlen = sizeof(int), | 599 | .maxlen = sizeof(int), |
657 | .mode = 0644, | 600 | .mode = 0644, |
658 | .proc_handler = &proc_dointvec_minmax, | 601 | .proc_handler = proc_dointvec_minmax, |
659 | .strategy = &sysctl_intvec, | ||
660 | .extra1 = &minolduid, | 602 | .extra1 = &minolduid, |
661 | .extra2 = &maxolduid, | 603 | .extra2 = &maxolduid, |
662 | }, | 604 | }, |
663 | { | 605 | { |
664 | .ctl_name = KERN_OVERFLOWGID, | ||
665 | .procname = "overflowgid", | 606 | .procname = "overflowgid", |
666 | .data = &overflowgid, | 607 | .data = &overflowgid, |
667 | .maxlen = sizeof(int), | 608 | .maxlen = sizeof(int), |
668 | .mode = 0644, | 609 | .mode = 0644, |
669 | .proc_handler = &proc_dointvec_minmax, | 610 | .proc_handler = proc_dointvec_minmax, |
670 | .strategy = &sysctl_intvec, | ||
671 | .extra1 = &minolduid, | 611 | .extra1 = &minolduid, |
672 | .extra2 = &maxolduid, | 612 | .extra2 = &maxolduid, |
673 | }, | 613 | }, |
674 | #ifdef CONFIG_S390 | 614 | #ifdef CONFIG_S390 |
675 | #ifdef CONFIG_MATHEMU | 615 | #ifdef CONFIG_MATHEMU |
676 | { | 616 | { |
677 | .ctl_name = KERN_IEEE_EMULATION_WARNINGS, | ||
678 | .procname = "ieee_emulation_warnings", | 617 | .procname = "ieee_emulation_warnings", |
679 | .data = &sysctl_ieee_emulation_warnings, | 618 | .data = &sysctl_ieee_emulation_warnings, |
680 | .maxlen = sizeof(int), | 619 | .maxlen = sizeof(int), |
681 | .mode = 0644, | 620 | .mode = 0644, |
682 | .proc_handler = &proc_dointvec, | 621 | .proc_handler = proc_dointvec, |
683 | }, | 622 | }, |
684 | #endif | 623 | #endif |
685 | { | 624 | { |
686 | .ctl_name = KERN_S390_USER_DEBUG_LOGGING, | ||
687 | .procname = "userprocess_debug", | 625 | .procname = "userprocess_debug", |
688 | .data = &sysctl_userprocess_debug, | 626 | .data = &sysctl_userprocess_debug, |
689 | .maxlen = sizeof(int), | 627 | .maxlen = sizeof(int), |
690 | .mode = 0644, | 628 | .mode = 0644, |
691 | .proc_handler = &proc_dointvec, | 629 | .proc_handler = proc_dointvec, |
692 | }, | 630 | }, |
693 | #endif | 631 | #endif |
694 | { | 632 | { |
695 | .ctl_name = KERN_PIDMAX, | ||
696 | .procname = "pid_max", | 633 | .procname = "pid_max", |
697 | .data = &pid_max, | 634 | .data = &pid_max, |
698 | .maxlen = sizeof (int), | 635 | .maxlen = sizeof (int), |
699 | .mode = 0644, | 636 | .mode = 0644, |
700 | .proc_handler = &proc_dointvec_minmax, | 637 | .proc_handler = proc_dointvec_minmax, |
701 | .strategy = sysctl_intvec, | ||
702 | .extra1 = &pid_max_min, | 638 | .extra1 = &pid_max_min, |
703 | .extra2 = &pid_max_max, | 639 | .extra2 = &pid_max_max, |
704 | }, | 640 | }, |
705 | { | 641 | { |
706 | .ctl_name = KERN_PANIC_ON_OOPS, | ||
707 | .procname = "panic_on_oops", | 642 | .procname = "panic_on_oops", |
708 | .data = &panic_on_oops, | 643 | .data = &panic_on_oops, |
709 | .maxlen = sizeof(int), | 644 | .maxlen = sizeof(int), |
710 | .mode = 0644, | 645 | .mode = 0644, |
711 | .proc_handler = &proc_dointvec, | 646 | .proc_handler = proc_dointvec, |
712 | }, | 647 | }, |
713 | #if defined CONFIG_PRINTK | 648 | #if defined CONFIG_PRINTK |
714 | { | 649 | { |
715 | .ctl_name = KERN_PRINTK, | ||
716 | .procname = "printk", | 650 | .procname = "printk", |
717 | .data = &console_loglevel, | 651 | .data = &console_loglevel, |
718 | .maxlen = 4*sizeof(int), | 652 | .maxlen = 4*sizeof(int), |
719 | .mode = 0644, | 653 | .mode = 0644, |
720 | .proc_handler = &proc_dointvec, | 654 | .proc_handler = proc_dointvec, |
721 | }, | 655 | }, |
722 | { | 656 | { |
723 | .ctl_name = KERN_PRINTK_RATELIMIT, | ||
724 | .procname = "printk_ratelimit", | 657 | .procname = "printk_ratelimit", |
725 | .data = &printk_ratelimit_state.interval, | 658 | .data = &printk_ratelimit_state.interval, |
726 | .maxlen = sizeof(int), | 659 | .maxlen = sizeof(int), |
727 | .mode = 0644, | 660 | .mode = 0644, |
728 | .proc_handler = &proc_dointvec_jiffies, | 661 | .proc_handler = proc_dointvec_jiffies, |
729 | .strategy = &sysctl_jiffies, | ||
730 | }, | 662 | }, |
731 | { | 663 | { |
732 | .ctl_name = KERN_PRINTK_RATELIMIT_BURST, | ||
733 | .procname = "printk_ratelimit_burst", | 664 | .procname = "printk_ratelimit_burst", |
734 | .data = &printk_ratelimit_state.burst, | 665 | .data = &printk_ratelimit_state.burst, |
735 | .maxlen = sizeof(int), | 666 | .maxlen = sizeof(int), |
736 | .mode = 0644, | 667 | .mode = 0644, |
737 | .proc_handler = &proc_dointvec, | 668 | .proc_handler = proc_dointvec, |
738 | }, | 669 | }, |
739 | { | 670 | { |
740 | .ctl_name = CTL_UNNUMBERED, | ||
741 | .procname = "printk_delay", | 671 | .procname = "printk_delay", |
742 | .data = &printk_delay_msec, | 672 | .data = &printk_delay_msec, |
743 | .maxlen = sizeof(int), | 673 | .maxlen = sizeof(int), |
744 | .mode = 0644, | 674 | .mode = 0644, |
745 | .proc_handler = &proc_dointvec_minmax, | 675 | .proc_handler = proc_dointvec_minmax, |
746 | .strategy = &sysctl_intvec, | ||
747 | .extra1 = &zero, | 676 | .extra1 = &zero, |
748 | .extra2 = &ten_thousand, | 677 | .extra2 = &ten_thousand, |
749 | }, | 678 | }, |
750 | #endif | 679 | #endif |
751 | { | 680 | { |
752 | .ctl_name = KERN_NGROUPS_MAX, | ||
753 | .procname = "ngroups_max", | 681 | .procname = "ngroups_max", |
754 | .data = &ngroups_max, | 682 | .data = &ngroups_max, |
755 | .maxlen = sizeof (int), | 683 | .maxlen = sizeof (int), |
756 | .mode = 0444, | 684 | .mode = 0444, |
757 | .proc_handler = &proc_dointvec, | 685 | .proc_handler = proc_dointvec, |
758 | }, | 686 | }, |
759 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) | 687 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) |
760 | { | 688 | { |
761 | .ctl_name = KERN_UNKNOWN_NMI_PANIC, | ||
762 | .procname = "unknown_nmi_panic", | 689 | .procname = "unknown_nmi_panic", |
763 | .data = &unknown_nmi_panic, | 690 | .data = &unknown_nmi_panic, |
764 | .maxlen = sizeof (int), | 691 | .maxlen = sizeof (int), |
765 | .mode = 0644, | 692 | .mode = 0644, |
766 | .proc_handler = &proc_dointvec, | 693 | .proc_handler = proc_dointvec, |
767 | }, | 694 | }, |
768 | { | 695 | { |
769 | .procname = "nmi_watchdog", | 696 | .procname = "nmi_watchdog", |
770 | .data = &nmi_watchdog_enabled, | 697 | .data = &nmi_watchdog_enabled, |
771 | .maxlen = sizeof (int), | 698 | .maxlen = sizeof (int), |
772 | .mode = 0644, | 699 | .mode = 0644, |
773 | .proc_handler = &proc_nmi_enabled, | 700 | .proc_handler = proc_nmi_enabled, |
774 | }, | 701 | }, |
775 | #endif | 702 | #endif |
776 | #if defined(CONFIG_X86) | 703 | #if defined(CONFIG_X86) |
777 | { | 704 | { |
778 | .ctl_name = KERN_PANIC_ON_NMI, | ||
779 | .procname = "panic_on_unrecovered_nmi", | 705 | .procname = "panic_on_unrecovered_nmi", |
780 | .data = &panic_on_unrecovered_nmi, | 706 | .data = &panic_on_unrecovered_nmi, |
781 | .maxlen = sizeof(int), | 707 | .maxlen = sizeof(int), |
782 | .mode = 0644, | 708 | .mode = 0644, |
783 | .proc_handler = &proc_dointvec, | 709 | .proc_handler = proc_dointvec, |
784 | }, | 710 | }, |
785 | { | 711 | { |
786 | .ctl_name = CTL_UNNUMBERED, | ||
787 | .procname = "panic_on_io_nmi", | 712 | .procname = "panic_on_io_nmi", |
788 | .data = &panic_on_io_nmi, | 713 | .data = &panic_on_io_nmi, |
789 | .maxlen = sizeof(int), | 714 | .maxlen = sizeof(int), |
790 | .mode = 0644, | 715 | .mode = 0644, |
791 | .proc_handler = &proc_dointvec, | 716 | .proc_handler = proc_dointvec, |
792 | }, | 717 | }, |
793 | { | 718 | { |
794 | .ctl_name = KERN_BOOTLOADER_TYPE, | ||
795 | .procname = "bootloader_type", | 719 | .procname = "bootloader_type", |
796 | .data = &bootloader_type, | 720 | .data = &bootloader_type, |
797 | .maxlen = sizeof (int), | 721 | .maxlen = sizeof (int), |
798 | .mode = 0444, | 722 | .mode = 0444, |
799 | .proc_handler = &proc_dointvec, | 723 | .proc_handler = proc_dointvec, |
800 | }, | 724 | }, |
801 | { | 725 | { |
802 | .ctl_name = CTL_UNNUMBERED, | ||
803 | .procname = "bootloader_version", | 726 | .procname = "bootloader_version", |
804 | .data = &bootloader_version, | 727 | .data = &bootloader_version, |
805 | .maxlen = sizeof (int), | 728 | .maxlen = sizeof (int), |
806 | .mode = 0444, | 729 | .mode = 0444, |
807 | .proc_handler = &proc_dointvec, | 730 | .proc_handler = proc_dointvec, |
808 | }, | 731 | }, |
809 | { | 732 | { |
810 | .ctl_name = CTL_UNNUMBERED, | ||
811 | .procname = "kstack_depth_to_print", | 733 | .procname = "kstack_depth_to_print", |
812 | .data = &kstack_depth_to_print, | 734 | .data = &kstack_depth_to_print, |
813 | .maxlen = sizeof(int), | 735 | .maxlen = sizeof(int), |
814 | .mode = 0644, | 736 | .mode = 0644, |
815 | .proc_handler = &proc_dointvec, | 737 | .proc_handler = proc_dointvec, |
816 | }, | 738 | }, |
817 | { | 739 | { |
818 | .ctl_name = CTL_UNNUMBERED, | ||
819 | .procname = "io_delay_type", | 740 | .procname = "io_delay_type", |
820 | .data = &io_delay_type, | 741 | .data = &io_delay_type, |
821 | .maxlen = sizeof(int), | 742 | .maxlen = sizeof(int), |
822 | .mode = 0644, | 743 | .mode = 0644, |
823 | .proc_handler = &proc_dointvec, | 744 | .proc_handler = proc_dointvec, |
824 | }, | 745 | }, |
825 | #endif | 746 | #endif |
826 | #if defined(CONFIG_MMU) | 747 | #if defined(CONFIG_MMU) |
827 | { | 748 | { |
828 | .ctl_name = KERN_RANDOMIZE, | ||
829 | .procname = "randomize_va_space", | 749 | .procname = "randomize_va_space", |
830 | .data = &randomize_va_space, | 750 | .data = &randomize_va_space, |
831 | .maxlen = sizeof(int), | 751 | .maxlen = sizeof(int), |
832 | .mode = 0644, | 752 | .mode = 0644, |
833 | .proc_handler = &proc_dointvec, | 753 | .proc_handler = proc_dointvec, |
834 | }, | 754 | }, |
835 | #endif | 755 | #endif |
836 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) | 756 | #if defined(CONFIG_S390) && defined(CONFIG_SMP) |
837 | { | 757 | { |
838 | .ctl_name = KERN_SPIN_RETRY, | ||
839 | .procname = "spin_retry", | 758 | .procname = "spin_retry", |
840 | .data = &spin_retry, | 759 | .data = &spin_retry, |
841 | .maxlen = sizeof (int), | 760 | .maxlen = sizeof (int), |
842 | .mode = 0644, | 761 | .mode = 0644, |
843 | .proc_handler = &proc_dointvec, | 762 | .proc_handler = proc_dointvec, |
844 | }, | 763 | }, |
845 | #endif | 764 | #endif |
846 | #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86) | 765 | #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86) |
@@ -849,123 +768,104 @@ static struct ctl_table kern_table[] = { | |||
849 | .data = &acpi_realmode_flags, | 768 | .data = &acpi_realmode_flags, |
850 | .maxlen = sizeof (unsigned long), | 769 | .maxlen = sizeof (unsigned long), |
851 | .mode = 0644, | 770 | .mode = 0644, |
852 | .proc_handler = &proc_doulongvec_minmax, | 771 | .proc_handler = proc_doulongvec_minmax, |
853 | }, | 772 | }, |
854 | #endif | 773 | #endif |
855 | #ifdef CONFIG_IA64 | 774 | #ifdef CONFIG_IA64 |
856 | { | 775 | { |
857 | .ctl_name = KERN_IA64_UNALIGNED, | ||
858 | .procname = "ignore-unaligned-usertrap", | 776 | .procname = "ignore-unaligned-usertrap", |
859 | .data = &no_unaligned_warning, | 777 | .data = &no_unaligned_warning, |
860 | .maxlen = sizeof (int), | 778 | .maxlen = sizeof (int), |
861 | .mode = 0644, | 779 | .mode = 0644, |
862 | .proc_handler = &proc_dointvec, | 780 | .proc_handler = proc_dointvec, |
863 | }, | 781 | }, |
864 | { | 782 | { |
865 | .ctl_name = CTL_UNNUMBERED, | ||
866 | .procname = "unaligned-dump-stack", | 783 | .procname = "unaligned-dump-stack", |
867 | .data = &unaligned_dump_stack, | 784 | .data = &unaligned_dump_stack, |
868 | .maxlen = sizeof (int), | 785 | .maxlen = sizeof (int), |
869 | .mode = 0644, | 786 | .mode = 0644, |
870 | .proc_handler = &proc_dointvec, | 787 | .proc_handler = proc_dointvec, |
871 | }, | 788 | }, |
872 | #endif | 789 | #endif |
873 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 790 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
874 | { | 791 | { |
875 | .ctl_name = CTL_UNNUMBERED, | ||
876 | .procname = "softlockup_panic", | 792 | .procname = "softlockup_panic", |
877 | .data = &softlockup_panic, | 793 | .data = &softlockup_panic, |
878 | .maxlen = sizeof(int), | 794 | .maxlen = sizeof(int), |
879 | .mode = 0644, | 795 | .mode = 0644, |
880 | .proc_handler = &proc_dointvec_minmax, | 796 | .proc_handler = proc_dointvec_minmax, |
881 | .strategy = &sysctl_intvec, | ||
882 | .extra1 = &zero, | 797 | .extra1 = &zero, |
883 | .extra2 = &one, | 798 | .extra2 = &one, |
884 | }, | 799 | }, |
885 | { | 800 | { |
886 | .ctl_name = CTL_UNNUMBERED, | ||
887 | .procname = "softlockup_thresh", | 801 | .procname = "softlockup_thresh", |
888 | .data = &softlockup_thresh, | 802 | .data = &softlockup_thresh, |
889 | .maxlen = sizeof(int), | 803 | .maxlen = sizeof(int), |
890 | .mode = 0644, | 804 | .mode = 0644, |
891 | .proc_handler = &proc_dosoftlockup_thresh, | 805 | .proc_handler = proc_dosoftlockup_thresh, |
892 | .strategy = &sysctl_intvec, | ||
893 | .extra1 = &neg_one, | 806 | .extra1 = &neg_one, |
894 | .extra2 = &sixty, | 807 | .extra2 = &sixty, |
895 | }, | 808 | }, |
896 | #endif | 809 | #endif |
897 | #ifdef CONFIG_DETECT_HUNG_TASK | 810 | #ifdef CONFIG_DETECT_HUNG_TASK |
898 | { | 811 | { |
899 | .ctl_name = CTL_UNNUMBERED, | ||
900 | .procname = "hung_task_panic", | 812 | .procname = "hung_task_panic", |
901 | .data = &sysctl_hung_task_panic, | 813 | .data = &sysctl_hung_task_panic, |
902 | .maxlen = sizeof(int), | 814 | .maxlen = sizeof(int), |
903 | .mode = 0644, | 815 | .mode = 0644, |
904 | .proc_handler = &proc_dointvec_minmax, | 816 | .proc_handler = proc_dointvec_minmax, |
905 | .strategy = &sysctl_intvec, | ||
906 | .extra1 = &zero, | 817 | .extra1 = &zero, |
907 | .extra2 = &one, | 818 | .extra2 = &one, |
908 | }, | 819 | }, |
909 | { | 820 | { |
910 | .ctl_name = CTL_UNNUMBERED, | ||
911 | .procname = "hung_task_check_count", | 821 | .procname = "hung_task_check_count", |
912 | .data = &sysctl_hung_task_check_count, | 822 | .data = &sysctl_hung_task_check_count, |
913 | .maxlen = sizeof(unsigned long), | 823 | .maxlen = sizeof(unsigned long), |
914 | .mode = 0644, | 824 | .mode = 0644, |
915 | .proc_handler = &proc_doulongvec_minmax, | 825 | .proc_handler = proc_doulongvec_minmax, |
916 | .strategy = &sysctl_intvec, | ||
917 | }, | 826 | }, |
918 | { | 827 | { |
919 | .ctl_name = CTL_UNNUMBERED, | ||
920 | .procname = "hung_task_timeout_secs", | 828 | .procname = "hung_task_timeout_secs", |
921 | .data = &sysctl_hung_task_timeout_secs, | 829 | .data = &sysctl_hung_task_timeout_secs, |
922 | .maxlen = sizeof(unsigned long), | 830 | .maxlen = sizeof(unsigned long), |
923 | .mode = 0644, | 831 | .mode = 0644, |
924 | .proc_handler = &proc_dohung_task_timeout_secs, | 832 | .proc_handler = proc_dohung_task_timeout_secs, |
925 | .strategy = &sysctl_intvec, | ||
926 | }, | 833 | }, |
927 | { | 834 | { |
928 | .ctl_name = CTL_UNNUMBERED, | ||
929 | .procname = "hung_task_warnings", | 835 | .procname = "hung_task_warnings", |
930 | .data = &sysctl_hung_task_warnings, | 836 | .data = &sysctl_hung_task_warnings, |
931 | .maxlen = sizeof(unsigned long), | 837 | .maxlen = sizeof(unsigned long), |
932 | .mode = 0644, | 838 | .mode = 0644, |
933 | .proc_handler = &proc_doulongvec_minmax, | 839 | .proc_handler = proc_doulongvec_minmax, |
934 | .strategy = &sysctl_intvec, | ||
935 | }, | 840 | }, |
936 | #endif | 841 | #endif |
937 | #ifdef CONFIG_COMPAT | 842 | #ifdef CONFIG_COMPAT |
938 | { | 843 | { |
939 | .ctl_name = KERN_COMPAT_LOG, | ||
940 | .procname = "compat-log", | 844 | .procname = "compat-log", |
941 | .data = &compat_log, | 845 | .data = &compat_log, |
942 | .maxlen = sizeof (int), | 846 | .maxlen = sizeof (int), |
943 | .mode = 0644, | 847 | .mode = 0644, |
944 | .proc_handler = &proc_dointvec, | 848 | .proc_handler = proc_dointvec, |
945 | }, | 849 | }, |
946 | #endif | 850 | #endif |
947 | #ifdef CONFIG_RT_MUTEXES | 851 | #ifdef CONFIG_RT_MUTEXES |
948 | { | 852 | { |
949 | .ctl_name = KERN_MAX_LOCK_DEPTH, | ||
950 | .procname = "max_lock_depth", | 853 | .procname = "max_lock_depth", |
951 | .data = &max_lock_depth, | 854 | .data = &max_lock_depth, |
952 | .maxlen = sizeof(int), | 855 | .maxlen = sizeof(int), |
953 | .mode = 0644, | 856 | .mode = 0644, |
954 | .proc_handler = &proc_dointvec, | 857 | .proc_handler = proc_dointvec, |
955 | }, | 858 | }, |
956 | #endif | 859 | #endif |
957 | { | 860 | { |
958 | .ctl_name = CTL_UNNUMBERED, | ||
959 | .procname = "poweroff_cmd", | 861 | .procname = "poweroff_cmd", |
960 | .data = &poweroff_cmd, | 862 | .data = &poweroff_cmd, |
961 | .maxlen = POWEROFF_CMD_PATH_LEN, | 863 | .maxlen = POWEROFF_CMD_PATH_LEN, |
962 | .mode = 0644, | 864 | .mode = 0644, |
963 | .proc_handler = &proc_dostring, | 865 | .proc_handler = proc_dostring, |
964 | .strategy = &sysctl_string, | ||
965 | }, | 866 | }, |
966 | #ifdef CONFIG_KEYS | 867 | #ifdef CONFIG_KEYS |
967 | { | 868 | { |
968 | .ctl_name = CTL_UNNUMBERED, | ||
969 | .procname = "keys", | 869 | .procname = "keys", |
970 | .mode = 0555, | 870 | .mode = 0555, |
971 | .child = key_sysctls, | 871 | .child = key_sysctls, |
@@ -973,17 +873,15 @@ static struct ctl_table kern_table[] = { | |||
973 | #endif | 873 | #endif |
974 | #ifdef CONFIG_RCU_TORTURE_TEST | 874 | #ifdef CONFIG_RCU_TORTURE_TEST |
975 | { | 875 | { |
976 | .ctl_name = CTL_UNNUMBERED, | ||
977 | .procname = "rcutorture_runnable", | 876 | .procname = "rcutorture_runnable", |
978 | .data = &rcutorture_runnable, | 877 | .data = &rcutorture_runnable, |
979 | .maxlen = sizeof(int), | 878 | .maxlen = sizeof(int), |
980 | .mode = 0644, | 879 | .mode = 0644, |
981 | .proc_handler = &proc_dointvec, | 880 | .proc_handler = proc_dointvec, |
982 | }, | 881 | }, |
983 | #endif | 882 | #endif |
984 | #ifdef CONFIG_SLOW_WORK | 883 | #ifdef CONFIG_SLOW_WORK |
985 | { | 884 | { |
986 | .ctl_name = CTL_UNNUMBERED, | ||
987 | .procname = "slow-work", | 885 | .procname = "slow-work", |
988 | .mode = 0555, | 886 | .mode = 0555, |
989 | .child = slow_work_sysctls, | 887 | .child = slow_work_sysctls, |
@@ -991,146 +889,127 @@ static struct ctl_table kern_table[] = { | |||
991 | #endif | 889 | #endif |
992 | #ifdef CONFIG_PERF_EVENTS | 890 | #ifdef CONFIG_PERF_EVENTS |
993 | { | 891 | { |
994 | .ctl_name = CTL_UNNUMBERED, | ||
995 | .procname = "perf_event_paranoid", | 892 | .procname = "perf_event_paranoid", |
996 | .data = &sysctl_perf_event_paranoid, | 893 | .data = &sysctl_perf_event_paranoid, |
997 | .maxlen = sizeof(sysctl_perf_event_paranoid), | 894 | .maxlen = sizeof(sysctl_perf_event_paranoid), |
998 | .mode = 0644, | 895 | .mode = 0644, |
999 | .proc_handler = &proc_dointvec, | 896 | .proc_handler = proc_dointvec, |
1000 | }, | 897 | }, |
1001 | { | 898 | { |
1002 | .ctl_name = CTL_UNNUMBERED, | ||
1003 | .procname = "perf_event_mlock_kb", | 899 | .procname = "perf_event_mlock_kb", |
1004 | .data = &sysctl_perf_event_mlock, | 900 | .data = &sysctl_perf_event_mlock, |
1005 | .maxlen = sizeof(sysctl_perf_event_mlock), | 901 | .maxlen = sizeof(sysctl_perf_event_mlock), |
1006 | .mode = 0644, | 902 | .mode = 0644, |
1007 | .proc_handler = &proc_dointvec, | 903 | .proc_handler = proc_dointvec, |
1008 | }, | 904 | }, |
1009 | { | 905 | { |
1010 | .ctl_name = CTL_UNNUMBERED, | ||
1011 | .procname = "perf_event_max_sample_rate", | 906 | .procname = "perf_event_max_sample_rate", |
1012 | .data = &sysctl_perf_event_sample_rate, | 907 | .data = &sysctl_perf_event_sample_rate, |
1013 | .maxlen = sizeof(sysctl_perf_event_sample_rate), | 908 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
1014 | .mode = 0644, | 909 | .mode = 0644, |
1015 | .proc_handler = &proc_dointvec, | 910 | .proc_handler = proc_dointvec, |
1016 | }, | 911 | }, |
1017 | #endif | 912 | #endif |
1018 | #ifdef CONFIG_KMEMCHECK | 913 | #ifdef CONFIG_KMEMCHECK |
1019 | { | 914 | { |
1020 | .ctl_name = CTL_UNNUMBERED, | ||
1021 | .procname = "kmemcheck", | 915 | .procname = "kmemcheck", |
1022 | .data = &kmemcheck_enabled, | 916 | .data = &kmemcheck_enabled, |
1023 | .maxlen = sizeof(int), | 917 | .maxlen = sizeof(int), |
1024 | .mode = 0644, | 918 | .mode = 0644, |
1025 | .proc_handler = &proc_dointvec, | 919 | .proc_handler = proc_dointvec, |
1026 | }, | 920 | }, |
1027 | #endif | 921 | #endif |
1028 | #ifdef CONFIG_BLOCK | 922 | #ifdef CONFIG_BLOCK |
1029 | { | 923 | { |
1030 | .ctl_name = CTL_UNNUMBERED, | ||
1031 | .procname = "blk_iopoll", | 924 | .procname = "blk_iopoll", |
1032 | .data = &blk_iopoll_enabled, | 925 | .data = &blk_iopoll_enabled, |
1033 | .maxlen = sizeof(int), | 926 | .maxlen = sizeof(int), |
1034 | .mode = 0644, | 927 | .mode = 0644, |
1035 | .proc_handler = &proc_dointvec, | 928 | .proc_handler = proc_dointvec, |
1036 | }, | 929 | }, |
1037 | #endif | 930 | #endif |
1038 | /* | 931 | /* |
1039 | * NOTE: do not add new entries to this table unless you have read | 932 | * NOTE: do not add new entries to this table unless you have read |
1040 | * Documentation/sysctl/ctl_unnumbered.txt | 933 | * Documentation/sysctl/ctl_unnumbered.txt |
1041 | */ | 934 | */ |
1042 | { .ctl_name = 0 } | 935 | { } |
1043 | }; | 936 | }; |
1044 | 937 | ||
1045 | static struct ctl_table vm_table[] = { | 938 | static struct ctl_table vm_table[] = { |
1046 | { | 939 | { |
1047 | .ctl_name = VM_OVERCOMMIT_MEMORY, | ||
1048 | .procname = "overcommit_memory", | 940 | .procname = "overcommit_memory", |
1049 | .data = &sysctl_overcommit_memory, | 941 | .data = &sysctl_overcommit_memory, |
1050 | .maxlen = sizeof(sysctl_overcommit_memory), | 942 | .maxlen = sizeof(sysctl_overcommit_memory), |
1051 | .mode = 0644, | 943 | .mode = 0644, |
1052 | .proc_handler = &proc_dointvec, | 944 | .proc_handler = proc_dointvec, |
1053 | }, | 945 | }, |
1054 | { | 946 | { |
1055 | .ctl_name = VM_PANIC_ON_OOM, | ||
1056 | .procname = "panic_on_oom", | 947 | .procname = "panic_on_oom", |
1057 | .data = &sysctl_panic_on_oom, | 948 | .data = &sysctl_panic_on_oom, |
1058 | .maxlen = sizeof(sysctl_panic_on_oom), | 949 | .maxlen = sizeof(sysctl_panic_on_oom), |
1059 | .mode = 0644, | 950 | .mode = 0644, |
1060 | .proc_handler = &proc_dointvec, | 951 | .proc_handler = proc_dointvec, |
1061 | }, | 952 | }, |
1062 | { | 953 | { |
1063 | .ctl_name = CTL_UNNUMBERED, | ||
1064 | .procname = "oom_kill_allocating_task", | 954 | .procname = "oom_kill_allocating_task", |
1065 | .data = &sysctl_oom_kill_allocating_task, | 955 | .data = &sysctl_oom_kill_allocating_task, |
1066 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), | 956 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), |
1067 | .mode = 0644, | 957 | .mode = 0644, |
1068 | .proc_handler = &proc_dointvec, | 958 | .proc_handler = proc_dointvec, |
1069 | }, | 959 | }, |
1070 | { | 960 | { |
1071 | .ctl_name = CTL_UNNUMBERED, | ||
1072 | .procname = "oom_dump_tasks", | 961 | .procname = "oom_dump_tasks", |
1073 | .data = &sysctl_oom_dump_tasks, | 962 | .data = &sysctl_oom_dump_tasks, |
1074 | .maxlen = sizeof(sysctl_oom_dump_tasks), | 963 | .maxlen = sizeof(sysctl_oom_dump_tasks), |
1075 | .mode = 0644, | 964 | .mode = 0644, |
1076 | .proc_handler = &proc_dointvec, | 965 | .proc_handler = proc_dointvec, |
1077 | }, | 966 | }, |
1078 | { | 967 | { |
1079 | .ctl_name = VM_OVERCOMMIT_RATIO, | ||
1080 | .procname = "overcommit_ratio", | 968 | .procname = "overcommit_ratio", |
1081 | .data = &sysctl_overcommit_ratio, | 969 | .data = &sysctl_overcommit_ratio, |
1082 | .maxlen = sizeof(sysctl_overcommit_ratio), | 970 | .maxlen = sizeof(sysctl_overcommit_ratio), |
1083 | .mode = 0644, | 971 | .mode = 0644, |
1084 | .proc_handler = &proc_dointvec, | 972 | .proc_handler = proc_dointvec, |
1085 | }, | 973 | }, |
1086 | { | 974 | { |
1087 | .ctl_name = VM_PAGE_CLUSTER, | ||
1088 | .procname = "page-cluster", | 975 | .procname = "page-cluster", |
1089 | .data = &page_cluster, | 976 | .data = &page_cluster, |
1090 | .maxlen = sizeof(int), | 977 | .maxlen = sizeof(int), |
1091 | .mode = 0644, | 978 | .mode = 0644, |
1092 | .proc_handler = &proc_dointvec, | 979 | .proc_handler = proc_dointvec, |
1093 | }, | 980 | }, |
1094 | { | 981 | { |
1095 | .ctl_name = VM_DIRTY_BACKGROUND, | ||
1096 | .procname = "dirty_background_ratio", | 982 | .procname = "dirty_background_ratio", |
1097 | .data = &dirty_background_ratio, | 983 | .data = &dirty_background_ratio, |
1098 | .maxlen = sizeof(dirty_background_ratio), | 984 | .maxlen = sizeof(dirty_background_ratio), |
1099 | .mode = 0644, | 985 | .mode = 0644, |
1100 | .proc_handler = &dirty_background_ratio_handler, | 986 | .proc_handler = dirty_background_ratio_handler, |
1101 | .strategy = &sysctl_intvec, | ||
1102 | .extra1 = &zero, | 987 | .extra1 = &zero, |
1103 | .extra2 = &one_hundred, | 988 | .extra2 = &one_hundred, |
1104 | }, | 989 | }, |
1105 | { | 990 | { |
1106 | .ctl_name = CTL_UNNUMBERED, | ||
1107 | .procname = "dirty_background_bytes", | 991 | .procname = "dirty_background_bytes", |
1108 | .data = &dirty_background_bytes, | 992 | .data = &dirty_background_bytes, |
1109 | .maxlen = sizeof(dirty_background_bytes), | 993 | .maxlen = sizeof(dirty_background_bytes), |
1110 | .mode = 0644, | 994 | .mode = 0644, |
1111 | .proc_handler = &dirty_background_bytes_handler, | 995 | .proc_handler = dirty_background_bytes_handler, |
1112 | .strategy = &sysctl_intvec, | ||
1113 | .extra1 = &one_ul, | 996 | .extra1 = &one_ul, |
1114 | }, | 997 | }, |
1115 | { | 998 | { |
1116 | .ctl_name = VM_DIRTY_RATIO, | ||
1117 | .procname = "dirty_ratio", | 999 | .procname = "dirty_ratio", |
1118 | .data = &vm_dirty_ratio, | 1000 | .data = &vm_dirty_ratio, |
1119 | .maxlen = sizeof(vm_dirty_ratio), | 1001 | .maxlen = sizeof(vm_dirty_ratio), |
1120 | .mode = 0644, | 1002 | .mode = 0644, |
1121 | .proc_handler = &dirty_ratio_handler, | 1003 | .proc_handler = dirty_ratio_handler, |
1122 | .strategy = &sysctl_intvec, | ||
1123 | .extra1 = &zero, | 1004 | .extra1 = &zero, |
1124 | .extra2 = &one_hundred, | 1005 | .extra2 = &one_hundred, |
1125 | }, | 1006 | }, |
1126 | { | 1007 | { |
1127 | .ctl_name = CTL_UNNUMBERED, | ||
1128 | .procname = "dirty_bytes", | 1008 | .procname = "dirty_bytes", |
1129 | .data = &vm_dirty_bytes, | 1009 | .data = &vm_dirty_bytes, |
1130 | .maxlen = sizeof(vm_dirty_bytes), | 1010 | .maxlen = sizeof(vm_dirty_bytes), |
1131 | .mode = 0644, | 1011 | .mode = 0644, |
1132 | .proc_handler = &dirty_bytes_handler, | 1012 | .proc_handler = dirty_bytes_handler, |
1133 | .strategy = &sysctl_intvec, | ||
1134 | .extra1 = &dirty_bytes_min, | 1013 | .extra1 = &dirty_bytes_min, |
1135 | }, | 1014 | }, |
1136 | { | 1015 | { |
@@ -1138,31 +1017,28 @@ static struct ctl_table vm_table[] = { | |||
1138 | .data = &dirty_writeback_interval, | 1017 | .data = &dirty_writeback_interval, |
1139 | .maxlen = sizeof(dirty_writeback_interval), | 1018 | .maxlen = sizeof(dirty_writeback_interval), |
1140 | .mode = 0644, | 1019 | .mode = 0644, |
1141 | .proc_handler = &dirty_writeback_centisecs_handler, | 1020 | .proc_handler = dirty_writeback_centisecs_handler, |
1142 | }, | 1021 | }, |
1143 | { | 1022 | { |
1144 | .procname = "dirty_expire_centisecs", | 1023 | .procname = "dirty_expire_centisecs", |
1145 | .data = &dirty_expire_interval, | 1024 | .data = &dirty_expire_interval, |
1146 | .maxlen = sizeof(dirty_expire_interval), | 1025 | .maxlen = sizeof(dirty_expire_interval), |
1147 | .mode = 0644, | 1026 | .mode = 0644, |
1148 | .proc_handler = &proc_dointvec, | 1027 | .proc_handler = proc_dointvec, |
1149 | }, | 1028 | }, |
1150 | { | 1029 | { |
1151 | .ctl_name = VM_NR_PDFLUSH_THREADS, | ||
1152 | .procname = "nr_pdflush_threads", | 1030 | .procname = "nr_pdflush_threads", |
1153 | .data = &nr_pdflush_threads, | 1031 | .data = &nr_pdflush_threads, |
1154 | .maxlen = sizeof nr_pdflush_threads, | 1032 | .maxlen = sizeof nr_pdflush_threads, |
1155 | .mode = 0444 /* read-only*/, | 1033 | .mode = 0444 /* read-only*/, |
1156 | .proc_handler = &proc_dointvec, | 1034 | .proc_handler = proc_dointvec, |
1157 | }, | 1035 | }, |
1158 | { | 1036 | { |
1159 | .ctl_name = VM_SWAPPINESS, | ||
1160 | .procname = "swappiness", | 1037 | .procname = "swappiness", |
1161 | .data = &vm_swappiness, | 1038 | .data = &vm_swappiness, |
1162 | .maxlen = sizeof(vm_swappiness), | 1039 | .maxlen = sizeof(vm_swappiness), |
1163 | .mode = 0644, | 1040 | .mode = 0644, |
1164 | .proc_handler = &proc_dointvec_minmax, | 1041 | .proc_handler = proc_dointvec_minmax, |
1165 | .strategy = &sysctl_intvec, | ||
1166 | .extra1 = &zero, | 1042 | .extra1 = &zero, |
1167 | .extra2 = &one_hundred, | 1043 | .extra2 = &one_hundred, |
1168 | }, | 1044 | }, |
@@ -1172,255 +1048,213 @@ static struct ctl_table vm_table[] = { | |||
1172 | .data = NULL, | 1048 | .data = NULL, |
1173 | .maxlen = sizeof(unsigned long), | 1049 | .maxlen = sizeof(unsigned long), |
1174 | .mode = 0644, | 1050 | .mode = 0644, |
1175 | .proc_handler = &hugetlb_sysctl_handler, | 1051 | .proc_handler = hugetlb_sysctl_handler, |
1176 | .extra1 = (void *)&hugetlb_zero, | 1052 | .extra1 = (void *)&hugetlb_zero, |
1177 | .extra2 = (void *)&hugetlb_infinity, | 1053 | .extra2 = (void *)&hugetlb_infinity, |
1178 | }, | 1054 | }, |
1179 | { | 1055 | { |
1180 | .ctl_name = VM_HUGETLB_GROUP, | ||
1181 | .procname = "hugetlb_shm_group", | 1056 | .procname = "hugetlb_shm_group", |
1182 | .data = &sysctl_hugetlb_shm_group, | 1057 | .data = &sysctl_hugetlb_shm_group, |
1183 | .maxlen = sizeof(gid_t), | 1058 | .maxlen = sizeof(gid_t), |
1184 | .mode = 0644, | 1059 | .mode = 0644, |
1185 | .proc_handler = &proc_dointvec, | 1060 | .proc_handler = proc_dointvec, |
1186 | }, | 1061 | }, |
1187 | { | 1062 | { |
1188 | .ctl_name = CTL_UNNUMBERED, | ||
1189 | .procname = "hugepages_treat_as_movable", | 1063 | .procname = "hugepages_treat_as_movable", |
1190 | .data = &hugepages_treat_as_movable, | 1064 | .data = &hugepages_treat_as_movable, |
1191 | .maxlen = sizeof(int), | 1065 | .maxlen = sizeof(int), |
1192 | .mode = 0644, | 1066 | .mode = 0644, |
1193 | .proc_handler = &hugetlb_treat_movable_handler, | 1067 | .proc_handler = hugetlb_treat_movable_handler, |
1194 | }, | 1068 | }, |
1195 | { | 1069 | { |
1196 | .ctl_name = CTL_UNNUMBERED, | ||
1197 | .procname = "nr_overcommit_hugepages", | 1070 | .procname = "nr_overcommit_hugepages", |
1198 | .data = NULL, | 1071 | .data = NULL, |
1199 | .maxlen = sizeof(unsigned long), | 1072 | .maxlen = sizeof(unsigned long), |
1200 | .mode = 0644, | 1073 | .mode = 0644, |
1201 | .proc_handler = &hugetlb_overcommit_handler, | 1074 | .proc_handler = hugetlb_overcommit_handler, |
1202 | .extra1 = (void *)&hugetlb_zero, | 1075 | .extra1 = (void *)&hugetlb_zero, |
1203 | .extra2 = (void *)&hugetlb_infinity, | 1076 | .extra2 = (void *)&hugetlb_infinity, |
1204 | }, | 1077 | }, |
1205 | #endif | 1078 | #endif |
1206 | { | 1079 | { |
1207 | .ctl_name = VM_LOWMEM_RESERVE_RATIO, | ||
1208 | .procname = "lowmem_reserve_ratio", | 1080 | .procname = "lowmem_reserve_ratio", |
1209 | .data = &sysctl_lowmem_reserve_ratio, | 1081 | .data = &sysctl_lowmem_reserve_ratio, |
1210 | .maxlen = sizeof(sysctl_lowmem_reserve_ratio), | 1082 | .maxlen = sizeof(sysctl_lowmem_reserve_ratio), |
1211 | .mode = 0644, | 1083 | .mode = 0644, |
1212 | .proc_handler = &lowmem_reserve_ratio_sysctl_handler, | 1084 | .proc_handler = lowmem_reserve_ratio_sysctl_handler, |
1213 | .strategy = &sysctl_intvec, | ||
1214 | }, | 1085 | }, |
1215 | { | 1086 | { |
1216 | .ctl_name = VM_DROP_PAGECACHE, | ||
1217 | .procname = "drop_caches", | 1087 | .procname = "drop_caches", |
1218 | .data = &sysctl_drop_caches, | 1088 | .data = &sysctl_drop_caches, |
1219 | .maxlen = sizeof(int), | 1089 | .maxlen = sizeof(int), |
1220 | .mode = 0644, | 1090 | .mode = 0644, |
1221 | .proc_handler = drop_caches_sysctl_handler, | 1091 | .proc_handler = drop_caches_sysctl_handler, |
1222 | .strategy = &sysctl_intvec, | ||
1223 | }, | 1092 | }, |
1224 | { | 1093 | { |
1225 | .ctl_name = VM_MIN_FREE_KBYTES, | ||
1226 | .procname = "min_free_kbytes", | 1094 | .procname = "min_free_kbytes", |
1227 | .data = &min_free_kbytes, | 1095 | .data = &min_free_kbytes, |
1228 | .maxlen = sizeof(min_free_kbytes), | 1096 | .maxlen = sizeof(min_free_kbytes), |
1229 | .mode = 0644, | 1097 | .mode = 0644, |
1230 | .proc_handler = &min_free_kbytes_sysctl_handler, | 1098 | .proc_handler = min_free_kbytes_sysctl_handler, |
1231 | .strategy = &sysctl_intvec, | ||
1232 | .extra1 = &zero, | 1099 | .extra1 = &zero, |
1233 | }, | 1100 | }, |
1234 | { | 1101 | { |
1235 | .ctl_name = VM_PERCPU_PAGELIST_FRACTION, | ||
1236 | .procname = "percpu_pagelist_fraction", | 1102 | .procname = "percpu_pagelist_fraction", |
1237 | .data = &percpu_pagelist_fraction, | 1103 | .data = &percpu_pagelist_fraction, |
1238 | .maxlen = sizeof(percpu_pagelist_fraction), | 1104 | .maxlen = sizeof(percpu_pagelist_fraction), |
1239 | .mode = 0644, | 1105 | .mode = 0644, |
1240 | .proc_handler = &percpu_pagelist_fraction_sysctl_handler, | 1106 | .proc_handler = percpu_pagelist_fraction_sysctl_handler, |
1241 | .strategy = &sysctl_intvec, | ||
1242 | .extra1 = &min_percpu_pagelist_fract, | 1107 | .extra1 = &min_percpu_pagelist_fract, |
1243 | }, | 1108 | }, |
1244 | #ifdef CONFIG_MMU | 1109 | #ifdef CONFIG_MMU |
1245 | { | 1110 | { |
1246 | .ctl_name = VM_MAX_MAP_COUNT, | ||
1247 | .procname = "max_map_count", | 1111 | .procname = "max_map_count", |
1248 | .data = &sysctl_max_map_count, | 1112 | .data = &sysctl_max_map_count, |
1249 | .maxlen = sizeof(sysctl_max_map_count), | 1113 | .maxlen = sizeof(sysctl_max_map_count), |
1250 | .mode = 0644, | 1114 | .mode = 0644, |
1251 | .proc_handler = &proc_dointvec | 1115 | .proc_handler = proc_dointvec |
1252 | }, | 1116 | }, |
1253 | #else | 1117 | #else |
1254 | { | 1118 | { |
1255 | .ctl_name = CTL_UNNUMBERED, | ||
1256 | .procname = "nr_trim_pages", | 1119 | .procname = "nr_trim_pages", |
1257 | .data = &sysctl_nr_trim_pages, | 1120 | .data = &sysctl_nr_trim_pages, |
1258 | .maxlen = sizeof(sysctl_nr_trim_pages), | 1121 | .maxlen = sizeof(sysctl_nr_trim_pages), |
1259 | .mode = 0644, | 1122 | .mode = 0644, |
1260 | .proc_handler = &proc_dointvec_minmax, | 1123 | .proc_handler = proc_dointvec_minmax, |
1261 | .strategy = &sysctl_intvec, | ||
1262 | .extra1 = &zero, | 1124 | .extra1 = &zero, |
1263 | }, | 1125 | }, |
1264 | #endif | 1126 | #endif |
1265 | { | 1127 | { |
1266 | .ctl_name = VM_LAPTOP_MODE, | ||
1267 | .procname = "laptop_mode", | 1128 | .procname = "laptop_mode", |
1268 | .data = &laptop_mode, | 1129 | .data = &laptop_mode, |
1269 | .maxlen = sizeof(laptop_mode), | 1130 | .maxlen = sizeof(laptop_mode), |
1270 | .mode = 0644, | 1131 | .mode = 0644, |
1271 | .proc_handler = &proc_dointvec_jiffies, | 1132 | .proc_handler = proc_dointvec_jiffies, |
1272 | .strategy = &sysctl_jiffies, | ||
1273 | }, | 1133 | }, |
1274 | { | 1134 | { |
1275 | .ctl_name = VM_BLOCK_DUMP, | ||
1276 | .procname = "block_dump", | 1135 | .procname = "block_dump", |
1277 | .data = &block_dump, | 1136 | .data = &block_dump, |
1278 | .maxlen = sizeof(block_dump), | 1137 | .maxlen = sizeof(block_dump), |
1279 | .mode = 0644, | 1138 | .mode = 0644, |
1280 | .proc_handler = &proc_dointvec, | 1139 | .proc_handler = proc_dointvec, |
1281 | .strategy = &sysctl_intvec, | ||
1282 | .extra1 = &zero, | 1140 | .extra1 = &zero, |
1283 | }, | 1141 | }, |
1284 | { | 1142 | { |
1285 | .ctl_name = VM_VFS_CACHE_PRESSURE, | ||
1286 | .procname = "vfs_cache_pressure", | 1143 | .procname = "vfs_cache_pressure", |
1287 | .data = &sysctl_vfs_cache_pressure, | 1144 | .data = &sysctl_vfs_cache_pressure, |
1288 | .maxlen = sizeof(sysctl_vfs_cache_pressure), | 1145 | .maxlen = sizeof(sysctl_vfs_cache_pressure), |
1289 | .mode = 0644, | 1146 | .mode = 0644, |
1290 | .proc_handler = &proc_dointvec, | 1147 | .proc_handler = proc_dointvec, |
1291 | .strategy = &sysctl_intvec, | ||
1292 | .extra1 = &zero, | 1148 | .extra1 = &zero, |
1293 | }, | 1149 | }, |
1294 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT | 1150 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT |
1295 | { | 1151 | { |
1296 | .ctl_name = VM_LEGACY_VA_LAYOUT, | ||
1297 | .procname = "legacy_va_layout", | 1152 | .procname = "legacy_va_layout", |
1298 | .data = &sysctl_legacy_va_layout, | 1153 | .data = &sysctl_legacy_va_layout, |
1299 | .maxlen = sizeof(sysctl_legacy_va_layout), | 1154 | .maxlen = sizeof(sysctl_legacy_va_layout), |
1300 | .mode = 0644, | 1155 | .mode = 0644, |
1301 | .proc_handler = &proc_dointvec, | 1156 | .proc_handler = proc_dointvec, |
1302 | .strategy = &sysctl_intvec, | ||
1303 | .extra1 = &zero, | 1157 | .extra1 = &zero, |
1304 | }, | 1158 | }, |
1305 | #endif | 1159 | #endif |
1306 | #ifdef CONFIG_NUMA | 1160 | #ifdef CONFIG_NUMA |
1307 | { | 1161 | { |
1308 | .ctl_name = VM_ZONE_RECLAIM_MODE, | ||
1309 | .procname = "zone_reclaim_mode", | 1162 | .procname = "zone_reclaim_mode", |
1310 | .data = &zone_reclaim_mode, | 1163 | .data = &zone_reclaim_mode, |
1311 | .maxlen = sizeof(zone_reclaim_mode), | 1164 | .maxlen = sizeof(zone_reclaim_mode), |
1312 | .mode = 0644, | 1165 | .mode = 0644, |
1313 | .proc_handler = &proc_dointvec, | 1166 | .proc_handler = proc_dointvec, |
1314 | .strategy = &sysctl_intvec, | ||
1315 | .extra1 = &zero, | 1167 | .extra1 = &zero, |
1316 | }, | 1168 | }, |
1317 | { | 1169 | { |
1318 | .ctl_name = VM_MIN_UNMAPPED, | ||
1319 | .procname = "min_unmapped_ratio", | 1170 | .procname = "min_unmapped_ratio", |
1320 | .data = &sysctl_min_unmapped_ratio, | 1171 | .data = &sysctl_min_unmapped_ratio, |
1321 | .maxlen = sizeof(sysctl_min_unmapped_ratio), | 1172 | .maxlen = sizeof(sysctl_min_unmapped_ratio), |
1322 | .mode = 0644, | 1173 | .mode = 0644, |
1323 | .proc_handler = &sysctl_min_unmapped_ratio_sysctl_handler, | 1174 | .proc_handler = sysctl_min_unmapped_ratio_sysctl_handler, |
1324 | .strategy = &sysctl_intvec, | ||
1325 | .extra1 = &zero, | 1175 | .extra1 = &zero, |
1326 | .extra2 = &one_hundred, | 1176 | .extra2 = &one_hundred, |
1327 | }, | 1177 | }, |
1328 | { | 1178 | { |
1329 | .ctl_name = VM_MIN_SLAB, | ||
1330 | .procname = "min_slab_ratio", | 1179 | .procname = "min_slab_ratio", |
1331 | .data = &sysctl_min_slab_ratio, | 1180 | .data = &sysctl_min_slab_ratio, |
1332 | .maxlen = sizeof(sysctl_min_slab_ratio), | 1181 | .maxlen = sizeof(sysctl_min_slab_ratio), |
1333 | .mode = 0644, | 1182 | .mode = 0644, |
1334 | .proc_handler = &sysctl_min_slab_ratio_sysctl_handler, | 1183 | .proc_handler = sysctl_min_slab_ratio_sysctl_handler, |
1335 | .strategy = &sysctl_intvec, | ||
1336 | .extra1 = &zero, | 1184 | .extra1 = &zero, |
1337 | .extra2 = &one_hundred, | 1185 | .extra2 = &one_hundred, |
1338 | }, | 1186 | }, |
1339 | #endif | 1187 | #endif |
1340 | #ifdef CONFIG_SMP | 1188 | #ifdef CONFIG_SMP |
1341 | { | 1189 | { |
1342 | .ctl_name = CTL_UNNUMBERED, | ||
1343 | .procname = "stat_interval", | 1190 | .procname = "stat_interval", |
1344 | .data = &sysctl_stat_interval, | 1191 | .data = &sysctl_stat_interval, |
1345 | .maxlen = sizeof(sysctl_stat_interval), | 1192 | .maxlen = sizeof(sysctl_stat_interval), |
1346 | .mode = 0644, | 1193 | .mode = 0644, |
1347 | .proc_handler = &proc_dointvec_jiffies, | 1194 | .proc_handler = proc_dointvec_jiffies, |
1348 | .strategy = &sysctl_jiffies, | ||
1349 | }, | 1195 | }, |
1350 | #endif | 1196 | #endif |
1351 | { | 1197 | { |
1352 | .ctl_name = CTL_UNNUMBERED, | ||
1353 | .procname = "mmap_min_addr", | 1198 | .procname = "mmap_min_addr", |
1354 | .data = &dac_mmap_min_addr, | 1199 | .data = &dac_mmap_min_addr, |
1355 | .maxlen = sizeof(unsigned long), | 1200 | .maxlen = sizeof(unsigned long), |
1356 | .mode = 0644, | 1201 | .mode = 0644, |
1357 | .proc_handler = &mmap_min_addr_handler, | 1202 | .proc_handler = mmap_min_addr_handler, |
1358 | }, | 1203 | }, |
1359 | #ifdef CONFIG_NUMA | 1204 | #ifdef CONFIG_NUMA |
1360 | { | 1205 | { |
1361 | .ctl_name = CTL_UNNUMBERED, | ||
1362 | .procname = "numa_zonelist_order", | 1206 | .procname = "numa_zonelist_order", |
1363 | .data = &numa_zonelist_order, | 1207 | .data = &numa_zonelist_order, |
1364 | .maxlen = NUMA_ZONELIST_ORDER_LEN, | 1208 | .maxlen = NUMA_ZONELIST_ORDER_LEN, |
1365 | .mode = 0644, | 1209 | .mode = 0644, |
1366 | .proc_handler = &numa_zonelist_order_handler, | 1210 | .proc_handler = numa_zonelist_order_handler, |
1367 | .strategy = &sysctl_string, | ||
1368 | }, | 1211 | }, |
1369 | #endif | 1212 | #endif |
1370 | #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ | 1213 | #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ |
1371 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) | 1214 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) |
1372 | { | 1215 | { |
1373 | .ctl_name = VM_VDSO_ENABLED, | ||
1374 | .procname = "vdso_enabled", | 1216 | .procname = "vdso_enabled", |
1375 | .data = &vdso_enabled, | 1217 | .data = &vdso_enabled, |
1376 | .maxlen = sizeof(vdso_enabled), | 1218 | .maxlen = sizeof(vdso_enabled), |
1377 | .mode = 0644, | 1219 | .mode = 0644, |
1378 | .proc_handler = &proc_dointvec, | 1220 | .proc_handler = proc_dointvec, |
1379 | .strategy = &sysctl_intvec, | ||
1380 | .extra1 = &zero, | 1221 | .extra1 = &zero, |
1381 | }, | 1222 | }, |
1382 | #endif | 1223 | #endif |
1383 | #ifdef CONFIG_HIGHMEM | 1224 | #ifdef CONFIG_HIGHMEM |
1384 | { | 1225 | { |
1385 | .ctl_name = CTL_UNNUMBERED, | ||
1386 | .procname = "highmem_is_dirtyable", | 1226 | .procname = "highmem_is_dirtyable", |
1387 | .data = &vm_highmem_is_dirtyable, | 1227 | .data = &vm_highmem_is_dirtyable, |
1388 | .maxlen = sizeof(vm_highmem_is_dirtyable), | 1228 | .maxlen = sizeof(vm_highmem_is_dirtyable), |
1389 | .mode = 0644, | 1229 | .mode = 0644, |
1390 | .proc_handler = &proc_dointvec_minmax, | 1230 | .proc_handler = proc_dointvec_minmax, |
1391 | .strategy = &sysctl_intvec, | ||
1392 | .extra1 = &zero, | 1231 | .extra1 = &zero, |
1393 | .extra2 = &one, | 1232 | .extra2 = &one, |
1394 | }, | 1233 | }, |
1395 | #endif | 1234 | #endif |
1396 | { | 1235 | { |
1397 | .ctl_name = CTL_UNNUMBERED, | ||
1398 | .procname = "scan_unevictable_pages", | 1236 | .procname = "scan_unevictable_pages", |
1399 | .data = &scan_unevictable_pages, | 1237 | .data = &scan_unevictable_pages, |
1400 | .maxlen = sizeof(scan_unevictable_pages), | 1238 | .maxlen = sizeof(scan_unevictable_pages), |
1401 | .mode = 0644, | 1239 | .mode = 0644, |
1402 | .proc_handler = &scan_unevictable_handler, | 1240 | .proc_handler = scan_unevictable_handler, |
1403 | }, | 1241 | }, |
1404 | #ifdef CONFIG_MEMORY_FAILURE | 1242 | #ifdef CONFIG_MEMORY_FAILURE |
1405 | { | 1243 | { |
1406 | .ctl_name = CTL_UNNUMBERED, | ||
1407 | .procname = "memory_failure_early_kill", | 1244 | .procname = "memory_failure_early_kill", |
1408 | .data = &sysctl_memory_failure_early_kill, | 1245 | .data = &sysctl_memory_failure_early_kill, |
1409 | .maxlen = sizeof(sysctl_memory_failure_early_kill), | 1246 | .maxlen = sizeof(sysctl_memory_failure_early_kill), |
1410 | .mode = 0644, | 1247 | .mode = 0644, |
1411 | .proc_handler = &proc_dointvec_minmax, | 1248 | .proc_handler = proc_dointvec_minmax, |
1412 | .strategy = &sysctl_intvec, | ||
1413 | .extra1 = &zero, | 1249 | .extra1 = &zero, |
1414 | .extra2 = &one, | 1250 | .extra2 = &one, |
1415 | }, | 1251 | }, |
1416 | { | 1252 | { |
1417 | .ctl_name = CTL_UNNUMBERED, | ||
1418 | .procname = "memory_failure_recovery", | 1253 | .procname = "memory_failure_recovery", |
1419 | .data = &sysctl_memory_failure_recovery, | 1254 | .data = &sysctl_memory_failure_recovery, |
1420 | .maxlen = sizeof(sysctl_memory_failure_recovery), | 1255 | .maxlen = sizeof(sysctl_memory_failure_recovery), |
1421 | .mode = 0644, | 1256 | .mode = 0644, |
1422 | .proc_handler = &proc_dointvec_minmax, | 1257 | .proc_handler = proc_dointvec_minmax, |
1423 | .strategy = &sysctl_intvec, | ||
1424 | .extra1 = &zero, | 1258 | .extra1 = &zero, |
1425 | .extra2 = &one, | 1259 | .extra2 = &one, |
1426 | }, | 1260 | }, |
@@ -1430,116 +1264,104 @@ static struct ctl_table vm_table[] = { | |||
1430 | * NOTE: do not add new entries to this table unless you have read | 1264 | * NOTE: do not add new entries to this table unless you have read |
1431 | * Documentation/sysctl/ctl_unnumbered.txt | 1265 | * Documentation/sysctl/ctl_unnumbered.txt |
1432 | */ | 1266 | */ |
1433 | { .ctl_name = 0 } | 1267 | { } |
1434 | }; | 1268 | }; |
1435 | 1269 | ||
1436 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | 1270 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
1437 | static struct ctl_table binfmt_misc_table[] = { | 1271 | static struct ctl_table binfmt_misc_table[] = { |
1438 | { .ctl_name = 0 } | 1272 | { } |
1439 | }; | 1273 | }; |
1440 | #endif | 1274 | #endif |
1441 | 1275 | ||
1442 | static struct ctl_table fs_table[] = { | 1276 | static struct ctl_table fs_table[] = { |
1443 | { | 1277 | { |
1444 | .ctl_name = FS_NRINODE, | ||
1445 | .procname = "inode-nr", | 1278 | .procname = "inode-nr", |
1446 | .data = &inodes_stat, | 1279 | .data = &inodes_stat, |
1447 | .maxlen = 2*sizeof(int), | 1280 | .maxlen = 2*sizeof(int), |
1448 | .mode = 0444, | 1281 | .mode = 0444, |
1449 | .proc_handler = &proc_dointvec, | 1282 | .proc_handler = proc_dointvec, |
1450 | }, | 1283 | }, |
1451 | { | 1284 | { |
1452 | .ctl_name = FS_STATINODE, | ||
1453 | .procname = "inode-state", | 1285 | .procname = "inode-state", |
1454 | .data = &inodes_stat, | 1286 | .data = &inodes_stat, |
1455 | .maxlen = 7*sizeof(int), | 1287 | .maxlen = 7*sizeof(int), |
1456 | .mode = 0444, | 1288 | .mode = 0444, |
1457 | .proc_handler = &proc_dointvec, | 1289 | .proc_handler = proc_dointvec, |
1458 | }, | 1290 | }, |
1459 | { | 1291 | { |
1460 | .procname = "file-nr", | 1292 | .procname = "file-nr", |
1461 | .data = &files_stat, | 1293 | .data = &files_stat, |
1462 | .maxlen = 3*sizeof(int), | 1294 | .maxlen = 3*sizeof(int), |
1463 | .mode = 0444, | 1295 | .mode = 0444, |
1464 | .proc_handler = &proc_nr_files, | 1296 | .proc_handler = proc_nr_files, |
1465 | }, | 1297 | }, |
1466 | { | 1298 | { |
1467 | .ctl_name = FS_MAXFILE, | ||
1468 | .procname = "file-max", | 1299 | .procname = "file-max", |
1469 | .data = &files_stat.max_files, | 1300 | .data = &files_stat.max_files, |
1470 | .maxlen = sizeof(int), | 1301 | .maxlen = sizeof(int), |
1471 | .mode = 0644, | 1302 | .mode = 0644, |
1472 | .proc_handler = &proc_dointvec, | 1303 | .proc_handler = proc_dointvec, |
1473 | }, | 1304 | }, |
1474 | { | 1305 | { |
1475 | .ctl_name = CTL_UNNUMBERED, | ||
1476 | .procname = "nr_open", | 1306 | .procname = "nr_open", |
1477 | .data = &sysctl_nr_open, | 1307 | .data = &sysctl_nr_open, |
1478 | .maxlen = sizeof(int), | 1308 | .maxlen = sizeof(int), |
1479 | .mode = 0644, | 1309 | .mode = 0644, |
1480 | .proc_handler = &proc_dointvec_minmax, | 1310 | .proc_handler = proc_dointvec_minmax, |
1481 | .extra1 = &sysctl_nr_open_min, | 1311 | .extra1 = &sysctl_nr_open_min, |
1482 | .extra2 = &sysctl_nr_open_max, | 1312 | .extra2 = &sysctl_nr_open_max, |
1483 | }, | 1313 | }, |
1484 | { | 1314 | { |
1485 | .ctl_name = FS_DENTRY, | ||
1486 | .procname = "dentry-state", | 1315 | .procname = "dentry-state", |
1487 | .data = &dentry_stat, | 1316 | .data = &dentry_stat, |
1488 | .maxlen = 6*sizeof(int), | 1317 | .maxlen = 6*sizeof(int), |
1489 | .mode = 0444, | 1318 | .mode = 0444, |
1490 | .proc_handler = &proc_dointvec, | 1319 | .proc_handler = proc_dointvec, |
1491 | }, | 1320 | }, |
1492 | { | 1321 | { |
1493 | .ctl_name = FS_OVERFLOWUID, | ||
1494 | .procname = "overflowuid", | 1322 | .procname = "overflowuid", |
1495 | .data = &fs_overflowuid, | 1323 | .data = &fs_overflowuid, |
1496 | .maxlen = sizeof(int), | 1324 | .maxlen = sizeof(int), |
1497 | .mode = 0644, | 1325 | .mode = 0644, |
1498 | .proc_handler = &proc_dointvec_minmax, | 1326 | .proc_handler = proc_dointvec_minmax, |
1499 | .strategy = &sysctl_intvec, | ||
1500 | .extra1 = &minolduid, | 1327 | .extra1 = &minolduid, |
1501 | .extra2 = &maxolduid, | 1328 | .extra2 = &maxolduid, |
1502 | }, | 1329 | }, |
1503 | { | 1330 | { |
1504 | .ctl_name = FS_OVERFLOWGID, | ||
1505 | .procname = "overflowgid", | 1331 | .procname = "overflowgid", |
1506 | .data = &fs_overflowgid, | 1332 | .data = &fs_overflowgid, |
1507 | .maxlen = sizeof(int), | 1333 | .maxlen = sizeof(int), |
1508 | .mode = 0644, | 1334 | .mode = 0644, |
1509 | .proc_handler = &proc_dointvec_minmax, | 1335 | .proc_handler = proc_dointvec_minmax, |
1510 | .strategy = &sysctl_intvec, | ||
1511 | .extra1 = &minolduid, | 1336 | .extra1 = &minolduid, |
1512 | .extra2 = &maxolduid, | 1337 | .extra2 = &maxolduid, |
1513 | }, | 1338 | }, |
1514 | #ifdef CONFIG_FILE_LOCKING | 1339 | #ifdef CONFIG_FILE_LOCKING |
1515 | { | 1340 | { |
1516 | .ctl_name = FS_LEASES, | ||
1517 | .procname = "leases-enable", | 1341 | .procname = "leases-enable", |
1518 | .data = &leases_enable, | 1342 | .data = &leases_enable, |
1519 | .maxlen = sizeof(int), | 1343 | .maxlen = sizeof(int), |
1520 | .mode = 0644, | 1344 | .mode = 0644, |
1521 | .proc_handler = &proc_dointvec, | 1345 | .proc_handler = proc_dointvec, |
1522 | }, | 1346 | }, |
1523 | #endif | 1347 | #endif |
1524 | #ifdef CONFIG_DNOTIFY | 1348 | #ifdef CONFIG_DNOTIFY |
1525 | { | 1349 | { |
1526 | .ctl_name = FS_DIR_NOTIFY, | ||
1527 | .procname = "dir-notify-enable", | 1350 | .procname = "dir-notify-enable", |
1528 | .data = &dir_notify_enable, | 1351 | .data = &dir_notify_enable, |
1529 | .maxlen = sizeof(int), | 1352 | .maxlen = sizeof(int), |
1530 | .mode = 0644, | 1353 | .mode = 0644, |
1531 | .proc_handler = &proc_dointvec, | 1354 | .proc_handler = proc_dointvec, |
1532 | }, | 1355 | }, |
1533 | #endif | 1356 | #endif |
1534 | #ifdef CONFIG_MMU | 1357 | #ifdef CONFIG_MMU |
1535 | #ifdef CONFIG_FILE_LOCKING | 1358 | #ifdef CONFIG_FILE_LOCKING |
1536 | { | 1359 | { |
1537 | .ctl_name = FS_LEASE_TIME, | ||
1538 | .procname = "lease-break-time", | 1360 | .procname = "lease-break-time", |
1539 | .data = &lease_break_time, | 1361 | .data = &lease_break_time, |
1540 | .maxlen = sizeof(int), | 1362 | .maxlen = sizeof(int), |
1541 | .mode = 0644, | 1363 | .mode = 0644, |
1542 | .proc_handler = &proc_dointvec, | 1364 | .proc_handler = proc_dointvec, |
1543 | }, | 1365 | }, |
1544 | #endif | 1366 | #endif |
1545 | #ifdef CONFIG_AIO | 1367 | #ifdef CONFIG_AIO |
@@ -1548,19 +1370,18 @@ static struct ctl_table fs_table[] = { | |||
1548 | .data = &aio_nr, | 1370 | .data = &aio_nr, |
1549 | .maxlen = sizeof(aio_nr), | 1371 | .maxlen = sizeof(aio_nr), |
1550 | .mode = 0444, | 1372 | .mode = 0444, |
1551 | .proc_handler = &proc_doulongvec_minmax, | 1373 | .proc_handler = proc_doulongvec_minmax, |
1552 | }, | 1374 | }, |
1553 | { | 1375 | { |
1554 | .procname = "aio-max-nr", | 1376 | .procname = "aio-max-nr", |
1555 | .data = &aio_max_nr, | 1377 | .data = &aio_max_nr, |
1556 | .maxlen = sizeof(aio_max_nr), | 1378 | .maxlen = sizeof(aio_max_nr), |
1557 | .mode = 0644, | 1379 | .mode = 0644, |
1558 | .proc_handler = &proc_doulongvec_minmax, | 1380 | .proc_handler = proc_doulongvec_minmax, |
1559 | }, | 1381 | }, |
1560 | #endif /* CONFIG_AIO */ | 1382 | #endif /* CONFIG_AIO */ |
1561 | #ifdef CONFIG_INOTIFY_USER | 1383 | #ifdef CONFIG_INOTIFY_USER |
1562 | { | 1384 | { |
1563 | .ctl_name = FS_INOTIFY, | ||
1564 | .procname = "inotify", | 1385 | .procname = "inotify", |
1565 | .mode = 0555, | 1386 | .mode = 0555, |
1566 | .child = inotify_table, | 1387 | .child = inotify_table, |
@@ -1575,19 +1396,16 @@ static struct ctl_table fs_table[] = { | |||
1575 | #endif | 1396 | #endif |
1576 | #endif | 1397 | #endif |
1577 | { | 1398 | { |
1578 | .ctl_name = KERN_SETUID_DUMPABLE, | ||
1579 | .procname = "suid_dumpable", | 1399 | .procname = "suid_dumpable", |
1580 | .data = &suid_dumpable, | 1400 | .data = &suid_dumpable, |
1581 | .maxlen = sizeof(int), | 1401 | .maxlen = sizeof(int), |
1582 | .mode = 0644, | 1402 | .mode = 0644, |
1583 | .proc_handler = &proc_dointvec_minmax, | 1403 | .proc_handler = proc_dointvec_minmax, |
1584 | .strategy = &sysctl_intvec, | ||
1585 | .extra1 = &zero, | 1404 | .extra1 = &zero, |
1586 | .extra2 = &two, | 1405 | .extra2 = &two, |
1587 | }, | 1406 | }, |
1588 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | 1407 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) |
1589 | { | 1408 | { |
1590 | .ctl_name = CTL_UNNUMBERED, | ||
1591 | .procname = "binfmt_misc", | 1409 | .procname = "binfmt_misc", |
1592 | .mode = 0555, | 1410 | .mode = 0555, |
1593 | .child = binfmt_misc_table, | 1411 | .child = binfmt_misc_table, |
@@ -1597,13 +1415,12 @@ static struct ctl_table fs_table[] = { | |||
1597 | * NOTE: do not add new entries to this table unless you have read | 1415 | * NOTE: do not add new entries to this table unless you have read |
1598 | * Documentation/sysctl/ctl_unnumbered.txt | 1416 | * Documentation/sysctl/ctl_unnumbered.txt |
1599 | */ | 1417 | */ |
1600 | { .ctl_name = 0 } | 1418 | { } |
1601 | }; | 1419 | }; |
1602 | 1420 | ||
1603 | static struct ctl_table debug_table[] = { | 1421 | static struct ctl_table debug_table[] = { |
1604 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) | 1422 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) |
1605 | { | 1423 | { |
1606 | .ctl_name = CTL_UNNUMBERED, | ||
1607 | .procname = "exception-trace", | 1424 | .procname = "exception-trace", |
1608 | .data = &show_unhandled_signals, | 1425 | .data = &show_unhandled_signals, |
1609 | .maxlen = sizeof(int), | 1426 | .maxlen = sizeof(int), |
@@ -1611,11 +1428,11 @@ static struct ctl_table debug_table[] = { | |||
1611 | .proc_handler = proc_dointvec | 1428 | .proc_handler = proc_dointvec |
1612 | }, | 1429 | }, |
1613 | #endif | 1430 | #endif |
1614 | { .ctl_name = 0 } | 1431 | { } |
1615 | }; | 1432 | }; |
1616 | 1433 | ||
1617 | static struct ctl_table dev_table[] = { | 1434 | static struct ctl_table dev_table[] = { |
1618 | { .ctl_name = 0 } | 1435 | { } |
1619 | }; | 1436 | }; |
1620 | 1437 | ||
1621 | static DEFINE_SPINLOCK(sysctl_lock); | 1438 | static DEFINE_SPINLOCK(sysctl_lock); |
@@ -1769,122 +1586,6 @@ void register_sysctl_root(struct ctl_table_root *root) | |||
1769 | spin_unlock(&sysctl_lock); | 1586 | spin_unlock(&sysctl_lock); |
1770 | } | 1587 | } |
1771 | 1588 | ||
1772 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
1773 | /* Perform the actual read/write of a sysctl table entry. */ | ||
1774 | static int do_sysctl_strategy(struct ctl_table_root *root, | ||
1775 | struct ctl_table *table, | ||
1776 | void __user *oldval, size_t __user *oldlenp, | ||
1777 | void __user *newval, size_t newlen) | ||
1778 | { | ||
1779 | int op = 0, rc; | ||
1780 | |||
1781 | if (oldval) | ||
1782 | op |= MAY_READ; | ||
1783 | if (newval) | ||
1784 | op |= MAY_WRITE; | ||
1785 | if (sysctl_perm(root, table, op)) | ||
1786 | return -EPERM; | ||
1787 | |||
1788 | if (table->strategy) { | ||
1789 | rc = table->strategy(table, oldval, oldlenp, newval, newlen); | ||
1790 | if (rc < 0) | ||
1791 | return rc; | ||
1792 | if (rc > 0) | ||
1793 | return 0; | ||
1794 | } | ||
1795 | |||
1796 | /* If there is no strategy routine, or if the strategy returns | ||
1797 | * zero, proceed with automatic r/w */ | ||
1798 | if (table->data && table->maxlen) { | ||
1799 | rc = sysctl_data(table, oldval, oldlenp, newval, newlen); | ||
1800 | if (rc < 0) | ||
1801 | return rc; | ||
1802 | } | ||
1803 | return 0; | ||
1804 | } | ||
1805 | |||
1806 | static int parse_table(int __user *name, int nlen, | ||
1807 | void __user *oldval, size_t __user *oldlenp, | ||
1808 | void __user *newval, size_t newlen, | ||
1809 | struct ctl_table_root *root, | ||
1810 | struct ctl_table *table) | ||
1811 | { | ||
1812 | int n; | ||
1813 | repeat: | ||
1814 | if (!nlen) | ||
1815 | return -ENOTDIR; | ||
1816 | if (get_user(n, name)) | ||
1817 | return -EFAULT; | ||
1818 | for ( ; table->ctl_name || table->procname; table++) { | ||
1819 | if (!table->ctl_name) | ||
1820 | continue; | ||
1821 | if (n == table->ctl_name) { | ||
1822 | int error; | ||
1823 | if (table->child) { | ||
1824 | if (sysctl_perm(root, table, MAY_EXEC)) | ||
1825 | return -EPERM; | ||
1826 | name++; | ||
1827 | nlen--; | ||
1828 | table = table->child; | ||
1829 | goto repeat; | ||
1830 | } | ||
1831 | error = do_sysctl_strategy(root, table, | ||
1832 | oldval, oldlenp, | ||
1833 | newval, newlen); | ||
1834 | return error; | ||
1835 | } | ||
1836 | } | ||
1837 | return -ENOTDIR; | ||
1838 | } | ||
1839 | |||
1840 | int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp, | ||
1841 | void __user *newval, size_t newlen) | ||
1842 | { | ||
1843 | struct ctl_table_header *head; | ||
1844 | int error = -ENOTDIR; | ||
1845 | |||
1846 | if (nlen <= 0 || nlen >= CTL_MAXNAME) | ||
1847 | return -ENOTDIR; | ||
1848 | if (oldval) { | ||
1849 | int old_len; | ||
1850 | if (!oldlenp || get_user(old_len, oldlenp)) | ||
1851 | return -EFAULT; | ||
1852 | } | ||
1853 | |||
1854 | for (head = sysctl_head_next(NULL); head; | ||
1855 | head = sysctl_head_next(head)) { | ||
1856 | error = parse_table(name, nlen, oldval, oldlenp, | ||
1857 | newval, newlen, | ||
1858 | head->root, head->ctl_table); | ||
1859 | if (error != -ENOTDIR) { | ||
1860 | sysctl_head_finish(head); | ||
1861 | break; | ||
1862 | } | ||
1863 | } | ||
1864 | return error; | ||
1865 | } | ||
1866 | |||
1867 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
1868 | { | ||
1869 | struct __sysctl_args tmp; | ||
1870 | int error; | ||
1871 | |||
1872 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
1873 | return -EFAULT; | ||
1874 | |||
1875 | error = deprecated_sysctl_warning(&tmp); | ||
1876 | if (error) | ||
1877 | goto out; | ||
1878 | |||
1879 | lock_kernel(); | ||
1880 | error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp, | ||
1881 | tmp.newval, tmp.newlen); | ||
1882 | unlock_kernel(); | ||
1883 | out: | ||
1884 | return error; | ||
1885 | } | ||
1886 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
1887 | |||
1888 | /* | 1589 | /* |
1889 | * sysctl_perm does NOT grant the superuser all rights automatically, because | 1590 | * sysctl_perm does NOT grant the superuser all rights automatically, because |
1890 | * some sysctl variables are readonly even to root. | 1591 | * some sysctl variables are readonly even to root. |
@@ -1920,7 +1621,7 @@ int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op) | |||
1920 | 1621 | ||
1921 | static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) | 1622 | static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) |
1922 | { | 1623 | { |
1923 | for (; table->ctl_name || table->procname; table++) { | 1624 | for (; table->procname; table++) { |
1924 | table->parent = parent; | 1625 | table->parent = parent; |
1925 | if (table->child) | 1626 | if (table->child) |
1926 | sysctl_set_parent(table, table->child); | 1627 | sysctl_set_parent(table, table->child); |
@@ -1952,11 +1653,11 @@ static struct ctl_table *is_branch_in(struct ctl_table *branch, | |||
1952 | return NULL; | 1653 | return NULL; |
1953 | 1654 | ||
1954 | /* ... and nothing else */ | 1655 | /* ... and nothing else */ |
1955 | if (branch[1].procname || branch[1].ctl_name) | 1656 | if (branch[1].procname) |
1956 | return NULL; | 1657 | return NULL; |
1957 | 1658 | ||
1958 | /* table should contain subdirectory with the same name */ | 1659 | /* table should contain subdirectory with the same name */ |
1959 | for (p = table; p->procname || p->ctl_name; p++) { | 1660 | for (p = table; p->procname; p++) { |
1960 | if (!p->child) | 1661 | if (!p->child) |
1961 | continue; | 1662 | continue; |
1962 | if (p->procname && strcmp(p->procname, s) == 0) | 1663 | if (p->procname && strcmp(p->procname, s) == 0) |
@@ -2001,9 +1702,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
2001 | * | 1702 | * |
2002 | * The members of the &struct ctl_table structure are used as follows: | 1703 | * The members of the &struct ctl_table structure are used as follows: |
2003 | * | 1704 | * |
2004 | * ctl_name - This is the numeric sysctl value used by sysctl(2). The number | ||
2005 | * must be unique within that level of sysctl | ||
2006 | * | ||
2007 | * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not | 1705 | * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not |
2008 | * enter a sysctl file | 1706 | * enter a sysctl file |
2009 | * | 1707 | * |
@@ -2018,8 +1716,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
2018 | * | 1716 | * |
2019 | * proc_handler - the text handler routine (described below) | 1717 | * proc_handler - the text handler routine (described below) |
2020 | * | 1718 | * |
2021 | * strategy - the strategy routine (described below) | ||
2022 | * | ||
2023 | * de - for internal use by the sysctl routines | 1719 | * de - for internal use by the sysctl routines |
2024 | * | 1720 | * |
2025 | * extra1, extra2 - extra pointers usable by the proc handler routines | 1721 | * extra1, extra2 - extra pointers usable by the proc handler routines |
@@ -2032,19 +1728,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | |||
2032 | * struct enable minimal validation of the values being written to be | 1728 | * struct enable minimal validation of the values being written to be |
2033 | * performed, and the mode field allows minimal authentication. | 1729 | * performed, and the mode field allows minimal authentication. |
2034 | * | 1730 | * |
2035 | * More sophisticated management can be enabled by the provision of a | ||
2036 | * strategy routine with the table entry. This will be called before | ||
2037 | * any automatic read or write of the data is performed. | ||
2038 | * | ||
2039 | * The strategy routine may return | ||
2040 | * | ||
2041 | * < 0 - Error occurred (error is passed to user process) | ||
2042 | * | ||
2043 | * 0 - OK - proceed with automatic read or write. | ||
2044 | * | ||
2045 | * > 0 - OK - read or write has been done by the strategy routine, so | ||
2046 | * return immediately. | ||
2047 | * | ||
2048 | * There must be a proc_handler routine for any terminal nodes | 1731 | * There must be a proc_handler routine for any terminal nodes |
2049 | * mirrored under /proc/sys (non-terminals are handled by a built-in | 1732 | * mirrored under /proc/sys (non-terminals are handled by a built-in |
2050 | * directory handler). Several default handlers are available to | 1733 | * directory handler). Several default handlers are available to |
@@ -2071,13 +1754,13 @@ struct ctl_table_header *__register_sysctl_paths( | |||
2071 | struct ctl_table_set *set; | 1754 | struct ctl_table_set *set; |
2072 | 1755 | ||
2073 | /* Count the path components */ | 1756 | /* Count the path components */ |
2074 | for (npath = 0; path[npath].ctl_name || path[npath].procname; ++npath) | 1757 | for (npath = 0; path[npath].procname; ++npath) |
2075 | ; | 1758 | ; |
2076 | 1759 | ||
2077 | /* | 1760 | /* |
2078 | * For each path component, allocate a 2-element ctl_table array. | 1761 | * For each path component, allocate a 2-element ctl_table array. |
2079 | * The first array element will be filled with the sysctl entry | 1762 | * The first array element will be filled with the sysctl entry |
2080 | * for this, the second will be the sentinel (ctl_name == 0). | 1763 | * for this, the second will be the sentinel (procname == 0). |
2081 | * | 1764 | * |
2082 | * We allocate everything in one go so that we don't have to | 1765 | * We allocate everything in one go so that we don't have to |
2083 | * worry about freeing additional memory in unregister_sysctl_table. | 1766 | * worry about freeing additional memory in unregister_sysctl_table. |
@@ -2094,7 +1777,6 @@ struct ctl_table_header *__register_sysctl_paths( | |||
2094 | for (n = 0; n < npath; ++n, ++path) { | 1777 | for (n = 0; n < npath; ++n, ++path) { |
2095 | /* Copy the procname */ | 1778 | /* Copy the procname */ |
2096 | new->procname = path->procname; | 1779 | new->procname = path->procname; |
2097 | new->ctl_name = path->ctl_name; | ||
2098 | new->mode = 0555; | 1780 | new->mode = 0555; |
2099 | 1781 | ||
2100 | *prevp = new; | 1782 | *prevp = new; |
@@ -2956,286 +2638,6 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | |||
2956 | 2638 | ||
2957 | #endif /* CONFIG_PROC_FS */ | 2639 | #endif /* CONFIG_PROC_FS */ |
2958 | 2640 | ||
2959 | |||
2960 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
2961 | /* | ||
2962 | * General sysctl support routines | ||
2963 | */ | ||
2964 | |||
2965 | /* The generic sysctl data routine (used if no strategy routine supplied) */ | ||
2966 | int sysctl_data(struct ctl_table *table, | ||
2967 | void __user *oldval, size_t __user *oldlenp, | ||
2968 | void __user *newval, size_t newlen) | ||
2969 | { | ||
2970 | size_t len; | ||
2971 | |||
2972 | /* Get out of I don't have a variable */ | ||
2973 | if (!table->data || !table->maxlen) | ||
2974 | return -ENOTDIR; | ||
2975 | |||
2976 | if (oldval && oldlenp) { | ||
2977 | if (get_user(len, oldlenp)) | ||
2978 | return -EFAULT; | ||
2979 | if (len) { | ||
2980 | if (len > table->maxlen) | ||
2981 | len = table->maxlen; | ||
2982 | if (copy_to_user(oldval, table->data, len)) | ||
2983 | return -EFAULT; | ||
2984 | if (put_user(len, oldlenp)) | ||
2985 | return -EFAULT; | ||
2986 | } | ||
2987 | } | ||
2988 | |||
2989 | if (newval && newlen) { | ||
2990 | if (newlen > table->maxlen) | ||
2991 | newlen = table->maxlen; | ||
2992 | |||
2993 | if (copy_from_user(table->data, newval, newlen)) | ||
2994 | return -EFAULT; | ||
2995 | } | ||
2996 | return 1; | ||
2997 | } | ||
2998 | |||
2999 | /* The generic string strategy routine: */ | ||
3000 | int sysctl_string(struct ctl_table *table, | ||
3001 | void __user *oldval, size_t __user *oldlenp, | ||
3002 | void __user *newval, size_t newlen) | ||
3003 | { | ||
3004 | if (!table->data || !table->maxlen) | ||
3005 | return -ENOTDIR; | ||
3006 | |||
3007 | if (oldval && oldlenp) { | ||
3008 | size_t bufsize; | ||
3009 | if (get_user(bufsize, oldlenp)) | ||
3010 | return -EFAULT; | ||
3011 | if (bufsize) { | ||
3012 | size_t len = strlen(table->data), copied; | ||
3013 | |||
3014 | /* This shouldn't trigger for a well-formed sysctl */ | ||
3015 | if (len > table->maxlen) | ||
3016 | len = table->maxlen; | ||
3017 | |||
3018 | /* Copy up to a max of bufsize-1 bytes of the string */ | ||
3019 | copied = (len >= bufsize) ? bufsize - 1 : len; | ||
3020 | |||
3021 | if (copy_to_user(oldval, table->data, copied) || | ||
3022 | put_user(0, (char __user *)(oldval + copied))) | ||
3023 | return -EFAULT; | ||
3024 | if (put_user(len, oldlenp)) | ||
3025 | return -EFAULT; | ||
3026 | } | ||
3027 | } | ||
3028 | if (newval && newlen) { | ||
3029 | size_t len = newlen; | ||
3030 | if (len > table->maxlen) | ||
3031 | len = table->maxlen; | ||
3032 | if(copy_from_user(table->data, newval, len)) | ||
3033 | return -EFAULT; | ||
3034 | if (len == table->maxlen) | ||
3035 | len--; | ||
3036 | ((char *) table->data)[len] = 0; | ||
3037 | } | ||
3038 | return 1; | ||
3039 | } | ||
3040 | |||
3041 | /* | ||
3042 | * This function makes sure that all of the integers in the vector | ||
3043 | * are between the minimum and maximum values given in the arrays | ||
3044 | * table->extra1 and table->extra2, respectively. | ||
3045 | */ | ||
3046 | int sysctl_intvec(struct ctl_table *table, | ||
3047 | void __user *oldval, size_t __user *oldlenp, | ||
3048 | void __user *newval, size_t newlen) | ||
3049 | { | ||
3050 | |||
3051 | if (newval && newlen) { | ||
3052 | int __user *vec = (int __user *) newval; | ||
3053 | int *min = (int *) table->extra1; | ||
3054 | int *max = (int *) table->extra2; | ||
3055 | size_t length; | ||
3056 | int i; | ||
3057 | |||
3058 | if (newlen % sizeof(int) != 0) | ||
3059 | return -EINVAL; | ||
3060 | |||
3061 | if (!table->extra1 && !table->extra2) | ||
3062 | return 0; | ||
3063 | |||
3064 | if (newlen > table->maxlen) | ||
3065 | newlen = table->maxlen; | ||
3066 | length = newlen / sizeof(int); | ||
3067 | |||
3068 | for (i = 0; i < length; i++) { | ||
3069 | int value; | ||
3070 | if (get_user(value, vec + i)) | ||
3071 | return -EFAULT; | ||
3072 | if (min && value < min[i]) | ||
3073 | return -EINVAL; | ||
3074 | if (max && value > max[i]) | ||
3075 | return -EINVAL; | ||
3076 | } | ||
3077 | } | ||
3078 | return 0; | ||
3079 | } | ||
3080 | |||
3081 | /* Strategy function to convert jiffies to seconds */ | ||
3082 | int sysctl_jiffies(struct ctl_table *table, | ||
3083 | void __user *oldval, size_t __user *oldlenp, | ||
3084 | void __user *newval, size_t newlen) | ||
3085 | { | ||
3086 | if (oldval && oldlenp) { | ||
3087 | size_t olen; | ||
3088 | |||
3089 | if (get_user(olen, oldlenp)) | ||
3090 | return -EFAULT; | ||
3091 | if (olen) { | ||
3092 | int val; | ||
3093 | |||
3094 | if (olen < sizeof(int)) | ||
3095 | return -EINVAL; | ||
3096 | |||
3097 | val = *(int *)(table->data) / HZ; | ||
3098 | if (put_user(val, (int __user *)oldval)) | ||
3099 | return -EFAULT; | ||
3100 | if (put_user(sizeof(int), oldlenp)) | ||
3101 | return -EFAULT; | ||
3102 | } | ||
3103 | } | ||
3104 | if (newval && newlen) { | ||
3105 | int new; | ||
3106 | if (newlen != sizeof(int)) | ||
3107 | return -EINVAL; | ||
3108 | if (get_user(new, (int __user *)newval)) | ||
3109 | return -EFAULT; | ||
3110 | *(int *)(table->data) = new*HZ; | ||
3111 | } | ||
3112 | return 1; | ||
3113 | } | ||
3114 | |||
3115 | /* Strategy function to convert jiffies to seconds */ | ||
3116 | int sysctl_ms_jiffies(struct ctl_table *table, | ||
3117 | void __user *oldval, size_t __user *oldlenp, | ||
3118 | void __user *newval, size_t newlen) | ||
3119 | { | ||
3120 | if (oldval && oldlenp) { | ||
3121 | size_t olen; | ||
3122 | |||
3123 | if (get_user(olen, oldlenp)) | ||
3124 | return -EFAULT; | ||
3125 | if (olen) { | ||
3126 | int val; | ||
3127 | |||
3128 | if (olen < sizeof(int)) | ||
3129 | return -EINVAL; | ||
3130 | |||
3131 | val = jiffies_to_msecs(*(int *)(table->data)); | ||
3132 | if (put_user(val, (int __user *)oldval)) | ||
3133 | return -EFAULT; | ||
3134 | if (put_user(sizeof(int), oldlenp)) | ||
3135 | return -EFAULT; | ||
3136 | } | ||
3137 | } | ||
3138 | if (newval && newlen) { | ||
3139 | int new; | ||
3140 | if (newlen != sizeof(int)) | ||
3141 | return -EINVAL; | ||
3142 | if (get_user(new, (int __user *)newval)) | ||
3143 | return -EFAULT; | ||
3144 | *(int *)(table->data) = msecs_to_jiffies(new); | ||
3145 | } | ||
3146 | return 1; | ||
3147 | } | ||
3148 | |||
3149 | |||
3150 | |||
3151 | #else /* CONFIG_SYSCTL_SYSCALL */ | ||
3152 | |||
3153 | |||
3154 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
3155 | { | ||
3156 | struct __sysctl_args tmp; | ||
3157 | int error; | ||
3158 | |||
3159 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
3160 | return -EFAULT; | ||
3161 | |||
3162 | error = deprecated_sysctl_warning(&tmp); | ||
3163 | |||
3164 | /* If no error reading the parameters then just -ENOSYS ... */ | ||
3165 | if (!error) | ||
3166 | error = -ENOSYS; | ||
3167 | |||
3168 | return error; | ||
3169 | } | ||
3170 | |||
3171 | int sysctl_data(struct ctl_table *table, | ||
3172 | void __user *oldval, size_t __user *oldlenp, | ||
3173 | void __user *newval, size_t newlen) | ||
3174 | { | ||
3175 | return -ENOSYS; | ||
3176 | } | ||
3177 | |||
3178 | int sysctl_string(struct ctl_table *table, | ||
3179 | void __user *oldval, size_t __user *oldlenp, | ||
3180 | void __user *newval, size_t newlen) | ||
3181 | { | ||
3182 | return -ENOSYS; | ||
3183 | } | ||
3184 | |||
3185 | int sysctl_intvec(struct ctl_table *table, | ||
3186 | void __user *oldval, size_t __user *oldlenp, | ||
3187 | void __user *newval, size_t newlen) | ||
3188 | { | ||
3189 | return -ENOSYS; | ||
3190 | } | ||
3191 | |||
3192 | int sysctl_jiffies(struct ctl_table *table, | ||
3193 | void __user *oldval, size_t __user *oldlenp, | ||
3194 | void __user *newval, size_t newlen) | ||
3195 | { | ||
3196 | return -ENOSYS; | ||
3197 | } | ||
3198 | |||
3199 | int sysctl_ms_jiffies(struct ctl_table *table, | ||
3200 | void __user *oldval, size_t __user *oldlenp, | ||
3201 | void __user *newval, size_t newlen) | ||
3202 | { | ||
3203 | return -ENOSYS; | ||
3204 | } | ||
3205 | |||
3206 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
3207 | |||
3208 | static int deprecated_sysctl_warning(struct __sysctl_args *args) | ||
3209 | { | ||
3210 | static int msg_count; | ||
3211 | int name[CTL_MAXNAME]; | ||
3212 | int i; | ||
3213 | |||
3214 | /* Check args->nlen. */ | ||
3215 | if (args->nlen < 0 || args->nlen > CTL_MAXNAME) | ||
3216 | return -ENOTDIR; | ||
3217 | |||
3218 | /* Read in the sysctl name for better debug message logging */ | ||
3219 | for (i = 0; i < args->nlen; i++) | ||
3220 | if (get_user(name[i], args->name + i)) | ||
3221 | return -EFAULT; | ||
3222 | |||
3223 | /* Ignore accesses to kernel.version */ | ||
3224 | if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION)) | ||
3225 | return 0; | ||
3226 | |||
3227 | if (msg_count < 5) { | ||
3228 | msg_count++; | ||
3229 | printk(KERN_INFO | ||
3230 | "warning: process `%s' used the deprecated sysctl " | ||
3231 | "system call with ", current->comm); | ||
3232 | for (i = 0; i < args->nlen; i++) | ||
3233 | printk("%d.", name[i]); | ||
3234 | printk("\n"); | ||
3235 | } | ||
3236 | return 0; | ||
3237 | } | ||
3238 | |||
3239 | /* | 2641 | /* |
3240 | * No sense putting this after each symbol definition, twice, | 2642 | * No sense putting this after each symbol definition, twice, |
3241 | * exception granted :-) | 2643 | * exception granted :-) |
@@ -3250,9 +2652,4 @@ EXPORT_SYMBOL(proc_doulongvec_minmax); | |||
3250 | EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); | 2652 | EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); |
3251 | EXPORT_SYMBOL(register_sysctl_table); | 2653 | EXPORT_SYMBOL(register_sysctl_table); |
3252 | EXPORT_SYMBOL(register_sysctl_paths); | 2654 | EXPORT_SYMBOL(register_sysctl_paths); |
3253 | EXPORT_SYMBOL(sysctl_intvec); | ||
3254 | EXPORT_SYMBOL(sysctl_jiffies); | ||
3255 | EXPORT_SYMBOL(sysctl_ms_jiffies); | ||
3256 | EXPORT_SYMBOL(sysctl_string); | ||
3257 | EXPORT_SYMBOL(sysctl_data); | ||
3258 | EXPORT_SYMBOL(unregister_sysctl_table); | 2655 | EXPORT_SYMBOL(unregister_sysctl_table); |
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c new file mode 100644 index 000000000000..b75dbf40f573 --- /dev/null +++ b/kernel/sysctl_binary.c | |||
@@ -0,0 +1,1507 @@ | |||
1 | #include <linux/stat.h> | ||
2 | #include <linux/sysctl.h> | ||
3 | #include "../fs/xfs/linux-2.6/xfs_sysctl.h" | ||
4 | #include <linux/sunrpc/debug.h> | ||
5 | #include <linux/string.h> | ||
6 | #include <net/ip_vs.h> | ||
7 | #include <linux/syscalls.h> | ||
8 | #include <linux/namei.h> | ||
9 | #include <linux/mount.h> | ||
10 | #include <linux/fs.h> | ||
11 | #include <linux/nsproxy.h> | ||
12 | #include <linux/pid_namespace.h> | ||
13 | #include <linux/file.h> | ||
14 | #include <linux/ctype.h> | ||
15 | #include <linux/netdevice.h> | ||
16 | |||
17 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
18 | |||
19 | struct bin_table; | ||
20 | typedef ssize_t bin_convert_t(struct file *file, | ||
21 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen); | ||
22 | |||
23 | static bin_convert_t bin_dir; | ||
24 | static bin_convert_t bin_string; | ||
25 | static bin_convert_t bin_intvec; | ||
26 | static bin_convert_t bin_ulongvec; | ||
27 | static bin_convert_t bin_uuid; | ||
28 | static bin_convert_t bin_dn_node_address; | ||
29 | |||
30 | #define CTL_DIR bin_dir | ||
31 | #define CTL_STR bin_string | ||
32 | #define CTL_INT bin_intvec | ||
33 | #define CTL_ULONG bin_ulongvec | ||
34 | #define CTL_UUID bin_uuid | ||
35 | #define CTL_DNADR bin_dn_node_address | ||
36 | |||
37 | #define BUFSZ 256 | ||
38 | |||
39 | struct bin_table { | ||
40 | bin_convert_t *convert; | ||
41 | int ctl_name; | ||
42 | const char *procname; | ||
43 | const struct bin_table *child; | ||
44 | }; | ||
45 | |||
46 | static const struct bin_table bin_random_table[] = { | ||
47 | { CTL_INT, RANDOM_POOLSIZE, "poolsize" }, | ||
48 | { CTL_INT, RANDOM_ENTROPY_COUNT, "entropy_avail" }, | ||
49 | { CTL_INT, RANDOM_READ_THRESH, "read_wakeup_threshold" }, | ||
50 | { CTL_INT, RANDOM_WRITE_THRESH, "write_wakeup_threshold" }, | ||
51 | { CTL_UUID, RANDOM_BOOT_ID, "boot_id" }, | ||
52 | { CTL_UUID, RANDOM_UUID, "uuid" }, | ||
53 | {} | ||
54 | }; | ||
55 | |||
56 | static const struct bin_table bin_pty_table[] = { | ||
57 | { CTL_INT, PTY_MAX, "max" }, | ||
58 | { CTL_INT, PTY_NR, "nr" }, | ||
59 | {} | ||
60 | }; | ||
61 | |||
62 | static const struct bin_table bin_kern_table[] = { | ||
63 | { CTL_STR, KERN_OSTYPE, "ostype" }, | ||
64 | { CTL_STR, KERN_OSRELEASE, "osrelease" }, | ||
65 | /* KERN_OSREV not used */ | ||
66 | { CTL_STR, KERN_VERSION, "version" }, | ||
67 | /* KERN_SECUREMASK not used */ | ||
68 | /* KERN_PROF not used */ | ||
69 | { CTL_STR, KERN_NODENAME, "hostname" }, | ||
70 | { CTL_STR, KERN_DOMAINNAME, "domainname" }, | ||
71 | |||
72 | { CTL_INT, KERN_PANIC, "panic" }, | ||
73 | { CTL_INT, KERN_REALROOTDEV, "real-root-dev" }, | ||
74 | |||
75 | { CTL_STR, KERN_SPARC_REBOOT, "reboot-cmd" }, | ||
76 | { CTL_INT, KERN_CTLALTDEL, "ctrl-alt-del" }, | ||
77 | { CTL_INT, KERN_PRINTK, "printk" }, | ||
78 | |||
79 | /* KERN_NAMETRANS not used */ | ||
80 | /* KERN_PPC_HTABRECLAIM not used */ | ||
81 | /* KERN_PPC_ZEROPAGED not used */ | ||
82 | { CTL_INT, KERN_PPC_POWERSAVE_NAP, "powersave-nap" }, | ||
83 | |||
84 | { CTL_STR, KERN_MODPROBE, "modprobe" }, | ||
85 | { CTL_INT, KERN_SG_BIG_BUFF, "sg-big-buff" }, | ||
86 | { CTL_INT, KERN_ACCT, "acct" }, | ||
87 | /* KERN_PPC_L2CR "l2cr" no longer used */ | ||
88 | |||
89 | /* KERN_RTSIGNR not used */ | ||
90 | /* KERN_RTSIGMAX not used */ | ||
91 | |||
92 | { CTL_ULONG, KERN_SHMMAX, "shmmax" }, | ||
93 | { CTL_INT, KERN_MSGMAX, "msgmax" }, | ||
94 | { CTL_INT, KERN_MSGMNB, "msgmnb" }, | ||
95 | /* KERN_MSGPOOL not used*/ | ||
96 | { CTL_INT, KERN_SYSRQ, "sysrq" }, | ||
97 | { CTL_INT, KERN_MAX_THREADS, "threads-max" }, | ||
98 | { CTL_DIR, KERN_RANDOM, "random", bin_random_table }, | ||
99 | { CTL_ULONG, KERN_SHMALL, "shmall" }, | ||
100 | { CTL_INT, KERN_MSGMNI, "msgmni" }, | ||
101 | { CTL_INT, KERN_SEM, "sem" }, | ||
102 | { CTL_INT, KERN_SPARC_STOP_A, "stop-a" }, | ||
103 | { CTL_INT, KERN_SHMMNI, "shmmni" }, | ||
104 | |||
105 | { CTL_INT, KERN_OVERFLOWUID, "overflowuid" }, | ||
106 | { CTL_INT, KERN_OVERFLOWGID, "overflowgid" }, | ||
107 | |||
108 | { CTL_STR, KERN_HOTPLUG, "hotplug", }, | ||
109 | { CTL_INT, KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" }, | ||
110 | |||
111 | { CTL_INT, KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" }, | ||
112 | { CTL_INT, KERN_CORE_USES_PID, "core_uses_pid" }, | ||
113 | /* KERN_TAINTED "tainted" no longer used */ | ||
114 | { CTL_INT, KERN_CADPID, "cad_pid" }, | ||
115 | { CTL_INT, KERN_PIDMAX, "pid_max" }, | ||
116 | { CTL_STR, KERN_CORE_PATTERN, "core_pattern" }, | ||
117 | { CTL_INT, KERN_PANIC_ON_OOPS, "panic_on_oops" }, | ||
118 | { CTL_INT, KERN_HPPA_PWRSW, "soft-power" }, | ||
119 | { CTL_INT, KERN_HPPA_UNALIGNED, "unaligned-trap" }, | ||
120 | |||
121 | { CTL_INT, KERN_PRINTK_RATELIMIT, "printk_ratelimit" }, | ||
122 | { CTL_INT, KERN_PRINTK_RATELIMIT_BURST, "printk_ratelimit_burst" }, | ||
123 | |||
124 | { CTL_DIR, KERN_PTY, "pty", bin_pty_table }, | ||
125 | { CTL_INT, KERN_NGROUPS_MAX, "ngroups_max" }, | ||
126 | { CTL_INT, KERN_SPARC_SCONS_PWROFF, "scons-poweroff" }, | ||
127 | /* KERN_HZ_TIMER "hz_timer" no longer used */ | ||
128 | { CTL_INT, KERN_UNKNOWN_NMI_PANIC, "unknown_nmi_panic" }, | ||
129 | { CTL_INT, KERN_BOOTLOADER_TYPE, "bootloader_type" }, | ||
130 | { CTL_INT, KERN_RANDOMIZE, "randomize_va_space" }, | ||
131 | |||
132 | { CTL_INT, KERN_SPIN_RETRY, "spin_retry" }, | ||
133 | /* KERN_ACPI_VIDEO_FLAGS "acpi_video_flags" no longer used */ | ||
134 | { CTL_INT, KERN_IA64_UNALIGNED, "ignore-unaligned-usertrap" }, | ||
135 | { CTL_INT, KERN_COMPAT_LOG, "compat-log" }, | ||
136 | { CTL_INT, KERN_MAX_LOCK_DEPTH, "max_lock_depth" }, | ||
137 | { CTL_INT, KERN_NMI_WATCHDOG, "nmi_watchdog" }, | ||
138 | { CTL_INT, KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" }, | ||
139 | {} | ||
140 | }; | ||
141 | |||
142 | static const struct bin_table bin_vm_table[] = { | ||
143 | { CTL_INT, VM_OVERCOMMIT_MEMORY, "overcommit_memory" }, | ||
144 | { CTL_INT, VM_PAGE_CLUSTER, "page-cluster" }, | ||
145 | { CTL_INT, VM_DIRTY_BACKGROUND, "dirty_background_ratio" }, | ||
146 | { CTL_INT, VM_DIRTY_RATIO, "dirty_ratio" }, | ||
147 | /* VM_DIRTY_WB_CS "dirty_writeback_centisecs" no longer used */ | ||
148 | /* VM_DIRTY_EXPIRE_CS "dirty_expire_centisecs" no longer used */ | ||
149 | { CTL_INT, VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads" }, | ||
150 | { CTL_INT, VM_OVERCOMMIT_RATIO, "overcommit_ratio" }, | ||
151 | /* VM_PAGEBUF unused */ | ||
152 | /* VM_HUGETLB_PAGES "nr_hugepages" no longer used */ | ||
153 | { CTL_INT, VM_SWAPPINESS, "swappiness" }, | ||
154 | { CTL_INT, VM_LOWMEM_RESERVE_RATIO, "lowmem_reserve_ratio" }, | ||
155 | { CTL_INT, VM_MIN_FREE_KBYTES, "min_free_kbytes" }, | ||
156 | { CTL_INT, VM_MAX_MAP_COUNT, "max_map_count" }, | ||
157 | { CTL_INT, VM_LAPTOP_MODE, "laptop_mode" }, | ||
158 | { CTL_INT, VM_BLOCK_DUMP, "block_dump" }, | ||
159 | { CTL_INT, VM_HUGETLB_GROUP, "hugetlb_shm_group" }, | ||
160 | { CTL_INT, VM_VFS_CACHE_PRESSURE, "vfs_cache_pressure" }, | ||
161 | { CTL_INT, VM_LEGACY_VA_LAYOUT, "legacy_va_layout" }, | ||
162 | /* VM_SWAP_TOKEN_TIMEOUT unused */ | ||
163 | { CTL_INT, VM_DROP_PAGECACHE, "drop_caches" }, | ||
164 | { CTL_INT, VM_PERCPU_PAGELIST_FRACTION, "percpu_pagelist_fraction" }, | ||
165 | { CTL_INT, VM_ZONE_RECLAIM_MODE, "zone_reclaim_mode" }, | ||
166 | { CTL_INT, VM_MIN_UNMAPPED, "min_unmapped_ratio" }, | ||
167 | { CTL_INT, VM_PANIC_ON_OOM, "panic_on_oom" }, | ||
168 | { CTL_INT, VM_VDSO_ENABLED, "vdso_enabled" }, | ||
169 | { CTL_INT, VM_MIN_SLAB, "min_slab_ratio" }, | ||
170 | |||
171 | {} | ||
172 | }; | ||
173 | |||
174 | static const struct bin_table bin_net_core_table[] = { | ||
175 | { CTL_INT, NET_CORE_WMEM_MAX, "wmem_max" }, | ||
176 | { CTL_INT, NET_CORE_RMEM_MAX, "rmem_max" }, | ||
177 | { CTL_INT, NET_CORE_WMEM_DEFAULT, "wmem_default" }, | ||
178 | { CTL_INT, NET_CORE_RMEM_DEFAULT, "rmem_default" }, | ||
179 | /* NET_CORE_DESTROY_DELAY unused */ | ||
180 | { CTL_INT, NET_CORE_MAX_BACKLOG, "netdev_max_backlog" }, | ||
181 | /* NET_CORE_FASTROUTE unused */ | ||
182 | { CTL_INT, NET_CORE_MSG_COST, "message_cost" }, | ||
183 | { CTL_INT, NET_CORE_MSG_BURST, "message_burst" }, | ||
184 | { CTL_INT, NET_CORE_OPTMEM_MAX, "optmem_max" }, | ||
185 | /* NET_CORE_HOT_LIST_LENGTH unused */ | ||
186 | /* NET_CORE_DIVERT_VERSION unused */ | ||
187 | /* NET_CORE_NO_CONG_THRESH unused */ | ||
188 | /* NET_CORE_NO_CONG unused */ | ||
189 | /* NET_CORE_LO_CONG unused */ | ||
190 | /* NET_CORE_MOD_CONG unused */ | ||
191 | { CTL_INT, NET_CORE_DEV_WEIGHT, "dev_weight" }, | ||
192 | { CTL_INT, NET_CORE_SOMAXCONN, "somaxconn" }, | ||
193 | { CTL_INT, NET_CORE_BUDGET, "netdev_budget" }, | ||
194 | { CTL_INT, NET_CORE_AEVENT_ETIME, "xfrm_aevent_etime" }, | ||
195 | { CTL_INT, NET_CORE_AEVENT_RSEQTH, "xfrm_aevent_rseqth" }, | ||
196 | { CTL_INT, NET_CORE_WARNINGS, "warnings" }, | ||
197 | {}, | ||
198 | }; | ||
199 | |||
200 | static const struct bin_table bin_net_unix_table[] = { | ||
201 | /* NET_UNIX_DESTROY_DELAY unused */ | ||
202 | /* NET_UNIX_DELETE_DELAY unused */ | ||
203 | { CTL_INT, NET_UNIX_MAX_DGRAM_QLEN, "max_dgram_qlen" }, | ||
204 | {} | ||
205 | }; | ||
206 | |||
207 | static const struct bin_table bin_net_ipv4_route_table[] = { | ||
208 | { CTL_INT, NET_IPV4_ROUTE_FLUSH, "flush" }, | ||
209 | /* NET_IPV4_ROUTE_MIN_DELAY "min_delay" no longer used */ | ||
210 | /* NET_IPV4_ROUTE_MAX_DELAY "max_delay" no longer used */ | ||
211 | { CTL_INT, NET_IPV4_ROUTE_GC_THRESH, "gc_thresh" }, | ||
212 | { CTL_INT, NET_IPV4_ROUTE_MAX_SIZE, "max_size" }, | ||
213 | { CTL_INT, NET_IPV4_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
214 | { CTL_INT, NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
215 | { CTL_INT, NET_IPV4_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
216 | { CTL_INT, NET_IPV4_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
217 | { CTL_INT, NET_IPV4_ROUTE_REDIRECT_LOAD, "redirect_load" }, | ||
218 | { CTL_INT, NET_IPV4_ROUTE_REDIRECT_NUMBER, "redirect_number" }, | ||
219 | { CTL_INT, NET_IPV4_ROUTE_REDIRECT_SILENCE, "redirect_silence" }, | ||
220 | { CTL_INT, NET_IPV4_ROUTE_ERROR_COST, "error_cost" }, | ||
221 | { CTL_INT, NET_IPV4_ROUTE_ERROR_BURST, "error_burst" }, | ||
222 | { CTL_INT, NET_IPV4_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
223 | { CTL_INT, NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
224 | { CTL_INT, NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" }, | ||
225 | { CTL_INT, NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
226 | { CTL_INT, NET_IPV4_ROUTE_SECRET_INTERVAL, "secret_interval" }, | ||
227 | {} | ||
228 | }; | ||
229 | |||
230 | static const struct bin_table bin_net_ipv4_conf_vars_table[] = { | ||
231 | { CTL_INT, NET_IPV4_CONF_FORWARDING, "forwarding" }, | ||
232 | { CTL_INT, NET_IPV4_CONF_MC_FORWARDING, "mc_forwarding" }, | ||
233 | |||
234 | { CTL_INT, NET_IPV4_CONF_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
235 | { CTL_INT, NET_IPV4_CONF_SECURE_REDIRECTS, "secure_redirects" }, | ||
236 | { CTL_INT, NET_IPV4_CONF_SEND_REDIRECTS, "send_redirects" }, | ||
237 | { CTL_INT, NET_IPV4_CONF_SHARED_MEDIA, "shared_media" }, | ||
238 | { CTL_INT, NET_IPV4_CONF_RP_FILTER, "rp_filter" }, | ||
239 | { CTL_INT, NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
240 | { CTL_INT, NET_IPV4_CONF_PROXY_ARP, "proxy_arp" }, | ||
241 | { CTL_INT, NET_IPV4_CONF_MEDIUM_ID, "medium_id" }, | ||
242 | { CTL_INT, NET_IPV4_CONF_BOOTP_RELAY, "bootp_relay" }, | ||
243 | { CTL_INT, NET_IPV4_CONF_LOG_MARTIANS, "log_martians" }, | ||
244 | { CTL_INT, NET_IPV4_CONF_TAG, "tag" }, | ||
245 | { CTL_INT, NET_IPV4_CONF_ARPFILTER, "arp_filter" }, | ||
246 | { CTL_INT, NET_IPV4_CONF_ARP_ANNOUNCE, "arp_announce" }, | ||
247 | { CTL_INT, NET_IPV4_CONF_ARP_IGNORE, "arp_ignore" }, | ||
248 | { CTL_INT, NET_IPV4_CONF_ARP_ACCEPT, "arp_accept" }, | ||
249 | { CTL_INT, NET_IPV4_CONF_ARP_NOTIFY, "arp_notify" }, | ||
250 | |||
251 | { CTL_INT, NET_IPV4_CONF_NOXFRM, "disable_xfrm" }, | ||
252 | { CTL_INT, NET_IPV4_CONF_NOPOLICY, "disable_policy" }, | ||
253 | { CTL_INT, NET_IPV4_CONF_FORCE_IGMP_VERSION, "force_igmp_version" }, | ||
254 | { CTL_INT, NET_IPV4_CONF_PROMOTE_SECONDARIES, "promote_secondaries" }, | ||
255 | {} | ||
256 | }; | ||
257 | |||
258 | static const struct bin_table bin_net_ipv4_conf_table[] = { | ||
259 | { CTL_DIR, NET_PROTO_CONF_ALL, "all", bin_net_ipv4_conf_vars_table }, | ||
260 | { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_ipv4_conf_vars_table }, | ||
261 | { CTL_DIR, 0, NULL, bin_net_ipv4_conf_vars_table }, | ||
262 | {} | ||
263 | }; | ||
264 | |||
265 | static const struct bin_table bin_net_neigh_vars_table[] = { | ||
266 | { CTL_INT, NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" }, | ||
267 | { CTL_INT, NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" }, | ||
268 | { CTL_INT, NET_NEIGH_APP_SOLICIT, "app_solicit" }, | ||
269 | /* NET_NEIGH_RETRANS_TIME "retrans_time" no longer used */ | ||
270 | { CTL_INT, NET_NEIGH_REACHABLE_TIME, "base_reachable_time" }, | ||
271 | { CTL_INT, NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" }, | ||
272 | { CTL_INT, NET_NEIGH_GC_STALE_TIME, "gc_stale_time" }, | ||
273 | { CTL_INT, NET_NEIGH_UNRES_QLEN, "unres_qlen" }, | ||
274 | { CTL_INT, NET_NEIGH_PROXY_QLEN, "proxy_qlen" }, | ||
275 | /* NET_NEIGH_ANYCAST_DELAY "anycast_delay" no longer used */ | ||
276 | /* NET_NEIGH_PROXY_DELAY "proxy_delay" no longer used */ | ||
277 | /* NET_NEIGH_LOCKTIME "locktime" no longer used */ | ||
278 | { CTL_INT, NET_NEIGH_GC_INTERVAL, "gc_interval" }, | ||
279 | { CTL_INT, NET_NEIGH_GC_THRESH1, "gc_thresh1" }, | ||
280 | { CTL_INT, NET_NEIGH_GC_THRESH2, "gc_thresh2" }, | ||
281 | { CTL_INT, NET_NEIGH_GC_THRESH3, "gc_thresh3" }, | ||
282 | { CTL_INT, NET_NEIGH_RETRANS_TIME_MS, "retrans_time_ms" }, | ||
283 | { CTL_INT, NET_NEIGH_REACHABLE_TIME_MS, "base_reachable_time_ms" }, | ||
284 | {} | ||
285 | }; | ||
286 | |||
287 | static const struct bin_table bin_net_neigh_table[] = { | ||
288 | { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_neigh_vars_table }, | ||
289 | { CTL_DIR, 0, NULL, bin_net_neigh_vars_table }, | ||
290 | {} | ||
291 | }; | ||
292 | |||
293 | static const struct bin_table bin_net_ipv4_netfilter_table[] = { | ||
294 | { CTL_INT, NET_IPV4_NF_CONNTRACK_MAX, "ip_conntrack_max" }, | ||
295 | |||
296 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT "ip_conntrack_tcp_timeout_syn_sent" no longer used */ | ||
297 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV "ip_conntrack_tcp_timeout_syn_recv" no longer used */ | ||
298 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED "ip_conntrack_tcp_timeout_established" no longer used */ | ||
299 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT "ip_conntrack_tcp_timeout_fin_wait" no longer used */ | ||
300 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT "ip_conntrack_tcp_timeout_close_wait" no longer used */ | ||
301 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK "ip_conntrack_tcp_timeout_last_ack" no longer used */ | ||
302 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT "ip_conntrack_tcp_timeout_time_wait" no longer used */ | ||
303 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE "ip_conntrack_tcp_timeout_close" no longer used */ | ||
304 | |||
305 | /* NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT "ip_conntrack_udp_timeout" no longer used */ | ||
306 | /* NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM "ip_conntrack_udp_timeout_stream" no longer used */ | ||
307 | /* NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT "ip_conntrack_icmp_timeout" no longer used */ | ||
308 | /* NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT "ip_conntrack_generic_timeout" no longer used */ | ||
309 | |||
310 | { CTL_INT, NET_IPV4_NF_CONNTRACK_BUCKETS, "ip_conntrack_buckets" }, | ||
311 | { CTL_INT, NET_IPV4_NF_CONNTRACK_LOG_INVALID, "ip_conntrack_log_invalid" }, | ||
312 | /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS "ip_conntrack_tcp_timeout_max_retrans" no longer used */ | ||
313 | { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_LOOSE, "ip_conntrack_tcp_loose" }, | ||
314 | { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL, "ip_conntrack_tcp_be_liberal" }, | ||
315 | { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS, "ip_conntrack_tcp_max_retrans" }, | ||
316 | |||
317 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED "ip_conntrack_sctp_timeout_closed" no longer used */ | ||
318 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT "ip_conntrack_sctp_timeout_cookie_wait" no longer used */ | ||
319 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED "ip_conntrack_sctp_timeout_cookie_echoed" no longer used */ | ||
320 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED "ip_conntrack_sctp_timeout_established" no longer used */ | ||
321 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT "ip_conntrack_sctp_timeout_shutdown_sent" no longer used */ | ||
322 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD "ip_conntrack_sctp_timeout_shutdown_recd" no longer used */ | ||
323 | /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT "ip_conntrack_sctp_timeout_shutdown_ack_sent" no longer used */ | ||
324 | |||
325 | { CTL_INT, NET_IPV4_NF_CONNTRACK_COUNT, "ip_conntrack_count" }, | ||
326 | { CTL_INT, NET_IPV4_NF_CONNTRACK_CHECKSUM, "ip_conntrack_checksum" }, | ||
327 | {} | ||
328 | }; | ||
329 | |||
330 | static const struct bin_table bin_net_ipv4_table[] = { | ||
331 | {CTL_INT, NET_IPV4_FORWARD, "ip_forward" }, | ||
332 | |||
333 | { CTL_DIR, NET_IPV4_CONF, "conf", bin_net_ipv4_conf_table }, | ||
334 | { CTL_DIR, NET_IPV4_NEIGH, "neigh", bin_net_neigh_table }, | ||
335 | { CTL_DIR, NET_IPV4_ROUTE, "route", bin_net_ipv4_route_table }, | ||
336 | /* NET_IPV4_FIB_HASH unused */ | ||
337 | { CTL_DIR, NET_IPV4_NETFILTER, "netfilter", bin_net_ipv4_netfilter_table }, | ||
338 | |||
339 | { CTL_INT, NET_IPV4_TCP_TIMESTAMPS, "tcp_timestamps" }, | ||
340 | { CTL_INT, NET_IPV4_TCP_WINDOW_SCALING, "tcp_window_scaling" }, | ||
341 | { CTL_INT, NET_IPV4_TCP_SACK, "tcp_sack" }, | ||
342 | { CTL_INT, NET_IPV4_TCP_RETRANS_COLLAPSE, "tcp_retrans_collapse" }, | ||
343 | { CTL_INT, NET_IPV4_DEFAULT_TTL, "ip_default_ttl" }, | ||
344 | /* NET_IPV4_AUTOCONFIG unused */ | ||
345 | { CTL_INT, NET_IPV4_NO_PMTU_DISC, "ip_no_pmtu_disc" }, | ||
346 | { CTL_INT, NET_IPV4_NONLOCAL_BIND, "ip_nonlocal_bind" }, | ||
347 | { CTL_INT, NET_IPV4_TCP_SYN_RETRIES, "tcp_syn_retries" }, | ||
348 | { CTL_INT, NET_TCP_SYNACK_RETRIES, "tcp_synack_retries" }, | ||
349 | { CTL_INT, NET_TCP_MAX_ORPHANS, "tcp_max_orphans" }, | ||
350 | { CTL_INT, NET_TCP_MAX_TW_BUCKETS, "tcp_max_tw_buckets" }, | ||
351 | { CTL_INT, NET_IPV4_DYNADDR, "ip_dynaddr" }, | ||
352 | { CTL_INT, NET_IPV4_TCP_KEEPALIVE_TIME, "tcp_keepalive_time" }, | ||
353 | { CTL_INT, NET_IPV4_TCP_KEEPALIVE_PROBES, "tcp_keepalive_probes" }, | ||
354 | { CTL_INT, NET_IPV4_TCP_KEEPALIVE_INTVL, "tcp_keepalive_intvl" }, | ||
355 | { CTL_INT, NET_IPV4_TCP_RETRIES1, "tcp_retries1" }, | ||
356 | { CTL_INT, NET_IPV4_TCP_RETRIES2, "tcp_retries2" }, | ||
357 | { CTL_INT, NET_IPV4_TCP_FIN_TIMEOUT, "tcp_fin_timeout" }, | ||
358 | { CTL_INT, NET_TCP_SYNCOOKIES, "tcp_syncookies" }, | ||
359 | { CTL_INT, NET_TCP_TW_RECYCLE, "tcp_tw_recycle" }, | ||
360 | { CTL_INT, NET_TCP_ABORT_ON_OVERFLOW, "tcp_abort_on_overflow" }, | ||
361 | { CTL_INT, NET_TCP_STDURG, "tcp_stdurg" }, | ||
362 | { CTL_INT, NET_TCP_RFC1337, "tcp_rfc1337" }, | ||
363 | { CTL_INT, NET_TCP_MAX_SYN_BACKLOG, "tcp_max_syn_backlog" }, | ||
364 | { CTL_INT, NET_IPV4_LOCAL_PORT_RANGE, "ip_local_port_range" }, | ||
365 | { CTL_INT, NET_IPV4_IGMP_MAX_MEMBERSHIPS, "igmp_max_memberships" }, | ||
366 | { CTL_INT, NET_IPV4_IGMP_MAX_MSF, "igmp_max_msf" }, | ||
367 | { CTL_INT, NET_IPV4_INET_PEER_THRESHOLD, "inet_peer_threshold" }, | ||
368 | { CTL_INT, NET_IPV4_INET_PEER_MINTTL, "inet_peer_minttl" }, | ||
369 | { CTL_INT, NET_IPV4_INET_PEER_MAXTTL, "inet_peer_maxttl" }, | ||
370 | { CTL_INT, NET_IPV4_INET_PEER_GC_MINTIME, "inet_peer_gc_mintime" }, | ||
371 | { CTL_INT, NET_IPV4_INET_PEER_GC_MAXTIME, "inet_peer_gc_maxtime" }, | ||
372 | { CTL_INT, NET_TCP_ORPHAN_RETRIES, "tcp_orphan_retries" }, | ||
373 | { CTL_INT, NET_TCP_FACK, "tcp_fack" }, | ||
374 | { CTL_INT, NET_TCP_REORDERING, "tcp_reordering" }, | ||
375 | { CTL_INT, NET_TCP_ECN, "tcp_ecn" }, | ||
376 | { CTL_INT, NET_TCP_DSACK, "tcp_dsack" }, | ||
377 | { CTL_INT, NET_TCP_MEM, "tcp_mem" }, | ||
378 | { CTL_INT, NET_TCP_WMEM, "tcp_wmem" }, | ||
379 | { CTL_INT, NET_TCP_RMEM, "tcp_rmem" }, | ||
380 | { CTL_INT, NET_TCP_APP_WIN, "tcp_app_win" }, | ||
381 | { CTL_INT, NET_TCP_ADV_WIN_SCALE, "tcp_adv_win_scale" }, | ||
382 | { CTL_INT, NET_TCP_TW_REUSE, "tcp_tw_reuse" }, | ||
383 | { CTL_INT, NET_TCP_FRTO, "tcp_frto" }, | ||
384 | { CTL_INT, NET_TCP_FRTO_RESPONSE, "tcp_frto_response" }, | ||
385 | { CTL_INT, NET_TCP_LOW_LATENCY, "tcp_low_latency" }, | ||
386 | { CTL_INT, NET_TCP_NO_METRICS_SAVE, "tcp_no_metrics_save" }, | ||
387 | { CTL_INT, NET_TCP_MODERATE_RCVBUF, "tcp_moderate_rcvbuf" }, | ||
388 | { CTL_INT, NET_TCP_TSO_WIN_DIVISOR, "tcp_tso_win_divisor" }, | ||
389 | { CTL_STR, NET_TCP_CONG_CONTROL, "tcp_congestion_control" }, | ||
390 | { CTL_INT, NET_TCP_ABC, "tcp_abc" }, | ||
391 | { CTL_INT, NET_TCP_MTU_PROBING, "tcp_mtu_probing" }, | ||
392 | { CTL_INT, NET_TCP_BASE_MSS, "tcp_base_mss" }, | ||
393 | { CTL_INT, NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, "tcp_workaround_signed_windows" }, | ||
394 | { CTL_INT, NET_TCP_DMA_COPYBREAK, "tcp_dma_copybreak" }, | ||
395 | { CTL_INT, NET_TCP_SLOW_START_AFTER_IDLE, "tcp_slow_start_after_idle" }, | ||
396 | { CTL_INT, NET_CIPSOV4_CACHE_ENABLE, "cipso_cache_enable" }, | ||
397 | { CTL_INT, NET_CIPSOV4_CACHE_BUCKET_SIZE, "cipso_cache_bucket_size" }, | ||
398 | { CTL_INT, NET_CIPSOV4_RBM_OPTFMT, "cipso_rbm_optfmt" }, | ||
399 | { CTL_INT, NET_CIPSOV4_RBM_STRICTVALID, "cipso_rbm_strictvalid" }, | ||
400 | /* NET_TCP_AVAIL_CONG_CONTROL "tcp_available_congestion_control" no longer used */ | ||
401 | { CTL_STR, NET_TCP_ALLOWED_CONG_CONTROL, "tcp_allowed_congestion_control" }, | ||
402 | { CTL_INT, NET_TCP_MAX_SSTHRESH, "tcp_max_ssthresh" }, | ||
403 | |||
404 | { CTL_INT, NET_IPV4_ICMP_ECHO_IGNORE_ALL, "icmp_echo_ignore_all" }, | ||
405 | { CTL_INT, NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" }, | ||
406 | { CTL_INT, NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "icmp_ignore_bogus_error_responses" }, | ||
407 | { CTL_INT, NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, "icmp_errors_use_inbound_ifaddr" }, | ||
408 | { CTL_INT, NET_IPV4_ICMP_RATELIMIT, "icmp_ratelimit" }, | ||
409 | { CTL_INT, NET_IPV4_ICMP_RATEMASK, "icmp_ratemask" }, | ||
410 | |||
411 | { CTL_INT, NET_IPV4_IPFRAG_HIGH_THRESH, "ipfrag_high_thresh" }, | ||
412 | { CTL_INT, NET_IPV4_IPFRAG_LOW_THRESH, "ipfrag_low_thresh" }, | ||
413 | { CTL_INT, NET_IPV4_IPFRAG_TIME, "ipfrag_time" }, | ||
414 | |||
415 | { CTL_INT, NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval" }, | ||
416 | /* NET_IPV4_IPFRAG_MAX_DIST "ipfrag_max_dist" no longer used */ | ||
417 | |||
418 | { CTL_INT, 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" }, | ||
419 | |||
420 | /* NET_TCP_DEFAULT_WIN_SCALE unused */ | ||
421 | /* NET_TCP_BIC_BETA unused */ | ||
422 | /* NET_IPV4_TCP_MAX_KA_PROBES unused */ | ||
423 | /* NET_IPV4_IP_MASQ_DEBUG unused */ | ||
424 | /* NET_TCP_SYN_TAILDROP unused */ | ||
425 | /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */ | ||
426 | /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */ | ||
427 | /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */ | ||
428 | /* NET_IPV4_ICMP_PARAMPROB_RATE unused */ | ||
429 | /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */ | ||
430 | /* NET_IPV4_ALWAYS_DEFRAG unused */ | ||
431 | {} | ||
432 | }; | ||
433 | |||
434 | static const struct bin_table bin_net_ipx_table[] = { | ||
435 | { CTL_INT, NET_IPX_PPROP_BROADCASTING, "ipx_pprop_broadcasting" }, | ||
436 | /* NET_IPX_FORWARDING unused */ | ||
437 | {} | ||
438 | }; | ||
439 | |||
440 | static const struct bin_table bin_net_atalk_table[] = { | ||
441 | { CTL_INT, NET_ATALK_AARP_EXPIRY_TIME, "aarp-expiry-time" }, | ||
442 | { CTL_INT, NET_ATALK_AARP_TICK_TIME, "aarp-tick-time" }, | ||
443 | { CTL_INT, NET_ATALK_AARP_RETRANSMIT_LIMIT, "aarp-retransmit-limit" }, | ||
444 | { CTL_INT, NET_ATALK_AARP_RESOLVE_TIME, "aarp-resolve-time" }, | ||
445 | {}, | ||
446 | }; | ||
447 | |||
448 | static const struct bin_table bin_net_netrom_table[] = { | ||
449 | { CTL_INT, NET_NETROM_DEFAULT_PATH_QUALITY, "default_path_quality" }, | ||
450 | { CTL_INT, NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, "obsolescence_count_initialiser" }, | ||
451 | { CTL_INT, NET_NETROM_NETWORK_TTL_INITIALISER, "network_ttl_initialiser" }, | ||
452 | { CTL_INT, NET_NETROM_TRANSPORT_TIMEOUT, "transport_timeout" }, | ||
453 | { CTL_INT, NET_NETROM_TRANSPORT_MAXIMUM_TRIES, "transport_maximum_tries" }, | ||
454 | { CTL_INT, NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, "transport_acknowledge_delay" }, | ||
455 | { CTL_INT, NET_NETROM_TRANSPORT_BUSY_DELAY, "transport_busy_delay" }, | ||
456 | { CTL_INT, NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, "transport_requested_window_size" }, | ||
457 | { CTL_INT, NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, "transport_no_activity_timeout" }, | ||
458 | { CTL_INT, NET_NETROM_ROUTING_CONTROL, "routing_control" }, | ||
459 | { CTL_INT, NET_NETROM_LINK_FAILS_COUNT, "link_fails_count" }, | ||
460 | { CTL_INT, NET_NETROM_RESET, "reset" }, | ||
461 | {} | ||
462 | }; | ||
463 | |||
464 | static const struct bin_table bin_net_ax25_param_table[] = { | ||
465 | { CTL_INT, NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" }, | ||
466 | { CTL_INT, NET_AX25_DEFAULT_MODE, "ax25_default_mode" }, | ||
467 | { CTL_INT, NET_AX25_BACKOFF_TYPE, "backoff_type" }, | ||
468 | { CTL_INT, NET_AX25_CONNECT_MODE, "connect_mode" }, | ||
469 | { CTL_INT, NET_AX25_STANDARD_WINDOW, "standard_window_size" }, | ||
470 | { CTL_INT, NET_AX25_EXTENDED_WINDOW, "extended_window_size" }, | ||
471 | { CTL_INT, NET_AX25_T1_TIMEOUT, "t1_timeout" }, | ||
472 | { CTL_INT, NET_AX25_T2_TIMEOUT, "t2_timeout" }, | ||
473 | { CTL_INT, NET_AX25_T3_TIMEOUT, "t3_timeout" }, | ||
474 | { CTL_INT, NET_AX25_IDLE_TIMEOUT, "idle_timeout" }, | ||
475 | { CTL_INT, NET_AX25_N2, "maximum_retry_count" }, | ||
476 | { CTL_INT, NET_AX25_PACLEN, "maximum_packet_length" }, | ||
477 | { CTL_INT, NET_AX25_PROTOCOL, "protocol" }, | ||
478 | { CTL_INT, NET_AX25_DAMA_SLAVE_TIMEOUT, "dama_slave_timeout" }, | ||
479 | {} | ||
480 | }; | ||
481 | |||
482 | static const struct bin_table bin_net_ax25_table[] = { | ||
483 | { CTL_DIR, 0, NULL, bin_net_ax25_param_table }, | ||
484 | {} | ||
485 | }; | ||
486 | |||
487 | static const struct bin_table bin_net_rose_table[] = { | ||
488 | { CTL_INT, NET_ROSE_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
489 | { CTL_INT, NET_ROSE_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
490 | { CTL_INT, NET_ROSE_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
491 | { CTL_INT, NET_ROSE_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
492 | { CTL_INT, NET_ROSE_ACK_HOLD_BACK_TIMEOUT, "acknowledge_hold_back_timeout" }, | ||
493 | { CTL_INT, NET_ROSE_ROUTING_CONTROL, "routing_control" }, | ||
494 | { CTL_INT, NET_ROSE_LINK_FAIL_TIMEOUT, "link_fail_timeout" }, | ||
495 | { CTL_INT, NET_ROSE_MAX_VCS, "maximum_virtual_circuits" }, | ||
496 | { CTL_INT, NET_ROSE_WINDOW_SIZE, "window_size" }, | ||
497 | { CTL_INT, NET_ROSE_NO_ACTIVITY_TIMEOUT, "no_activity_timeout" }, | ||
498 | {} | ||
499 | }; | ||
500 | |||
501 | static const struct bin_table bin_net_ipv6_conf_var_table[] = { | ||
502 | { CTL_INT, NET_IPV6_FORWARDING, "forwarding" }, | ||
503 | { CTL_INT, NET_IPV6_HOP_LIMIT, "hop_limit" }, | ||
504 | { CTL_INT, NET_IPV6_MTU, "mtu" }, | ||
505 | { CTL_INT, NET_IPV6_ACCEPT_RA, "accept_ra" }, | ||
506 | { CTL_INT, NET_IPV6_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
507 | { CTL_INT, NET_IPV6_AUTOCONF, "autoconf" }, | ||
508 | { CTL_INT, NET_IPV6_DAD_TRANSMITS, "dad_transmits" }, | ||
509 | { CTL_INT, NET_IPV6_RTR_SOLICITS, "router_solicitations" }, | ||
510 | { CTL_INT, NET_IPV6_RTR_SOLICIT_INTERVAL, "router_solicitation_interval" }, | ||
511 | { CTL_INT, NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay" }, | ||
512 | { CTL_INT, NET_IPV6_USE_TEMPADDR, "use_tempaddr" }, | ||
513 | { CTL_INT, NET_IPV6_TEMP_VALID_LFT, "temp_valid_lft" }, | ||
514 | { CTL_INT, NET_IPV6_TEMP_PREFERED_LFT, "temp_prefered_lft" }, | ||
515 | { CTL_INT, NET_IPV6_REGEN_MAX_RETRY, "regen_max_retry" }, | ||
516 | { CTL_INT, NET_IPV6_MAX_DESYNC_FACTOR, "max_desync_factor" }, | ||
517 | { CTL_INT, NET_IPV6_MAX_ADDRESSES, "max_addresses" }, | ||
518 | { CTL_INT, NET_IPV6_FORCE_MLD_VERSION, "force_mld_version" }, | ||
519 | { CTL_INT, NET_IPV6_ACCEPT_RA_DEFRTR, "accept_ra_defrtr" }, | ||
520 | { CTL_INT, NET_IPV6_ACCEPT_RA_PINFO, "accept_ra_pinfo" }, | ||
521 | { CTL_INT, NET_IPV6_ACCEPT_RA_RTR_PREF, "accept_ra_rtr_pref" }, | ||
522 | { CTL_INT, NET_IPV6_RTR_PROBE_INTERVAL, "router_probe_interval" }, | ||
523 | { CTL_INT, NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, "accept_ra_rt_info_max_plen" }, | ||
524 | { CTL_INT, NET_IPV6_PROXY_NDP, "proxy_ndp" }, | ||
525 | { CTL_INT, NET_IPV6_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
526 | {} | ||
527 | }; | ||
528 | |||
529 | static const struct bin_table bin_net_ipv6_conf_table[] = { | ||
530 | { CTL_DIR, NET_PROTO_CONF_ALL, "all", bin_net_ipv6_conf_var_table }, | ||
531 | { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_ipv6_conf_var_table }, | ||
532 | { CTL_DIR, 0, NULL, bin_net_ipv6_conf_var_table }, | ||
533 | {} | ||
534 | }; | ||
535 | |||
536 | static const struct bin_table bin_net_ipv6_route_table[] = { | ||
537 | /* NET_IPV6_ROUTE_FLUSH "flush" no longer used */ | ||
538 | { CTL_INT, NET_IPV6_ROUTE_GC_THRESH, "gc_thresh" }, | ||
539 | { CTL_INT, NET_IPV6_ROUTE_MAX_SIZE, "max_size" }, | ||
540 | { CTL_INT, NET_IPV6_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
541 | { CTL_INT, NET_IPV6_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
542 | { CTL_INT, NET_IPV6_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
543 | { CTL_INT, NET_IPV6_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
544 | { CTL_INT, NET_IPV6_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
545 | { CTL_INT, NET_IPV6_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
546 | { CTL_INT, NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
547 | {} | ||
548 | }; | ||
549 | |||
550 | static const struct bin_table bin_net_ipv6_icmp_table[] = { | ||
551 | { CTL_INT, NET_IPV6_ICMP_RATELIMIT, "ratelimit" }, | ||
552 | {} | ||
553 | }; | ||
554 | |||
555 | static const struct bin_table bin_net_ipv6_table[] = { | ||
556 | { CTL_DIR, NET_IPV6_CONF, "conf", bin_net_ipv6_conf_table }, | ||
557 | { CTL_DIR, NET_IPV6_NEIGH, "neigh", bin_net_neigh_table }, | ||
558 | { CTL_DIR, NET_IPV6_ROUTE, "route", bin_net_ipv6_route_table }, | ||
559 | { CTL_DIR, NET_IPV6_ICMP, "icmp", bin_net_ipv6_icmp_table }, | ||
560 | { CTL_INT, NET_IPV6_BINDV6ONLY, "bindv6only" }, | ||
561 | { CTL_INT, NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" }, | ||
562 | { CTL_INT, NET_IPV6_IP6FRAG_LOW_THRESH, "ip6frag_low_thresh" }, | ||
563 | { CTL_INT, NET_IPV6_IP6FRAG_TIME, "ip6frag_time" }, | ||
564 | { CTL_INT, NET_IPV6_IP6FRAG_SECRET_INTERVAL, "ip6frag_secret_interval" }, | ||
565 | { CTL_INT, NET_IPV6_MLD_MAX_MSF, "mld_max_msf" }, | ||
566 | { CTL_INT, 2088 /* IPQ_QMAX */, "ip6_queue_maxlen" }, | ||
567 | {} | ||
568 | }; | ||
569 | |||
570 | static const struct bin_table bin_net_x25_table[] = { | ||
571 | { CTL_INT, NET_X25_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
572 | { CTL_INT, NET_X25_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
573 | { CTL_INT, NET_X25_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
574 | { CTL_INT, NET_X25_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
575 | { CTL_INT, NET_X25_ACK_HOLD_BACK_TIMEOUT, "acknowledgement_hold_back_timeout" }, | ||
576 | { CTL_INT, NET_X25_FORWARD, "x25_forward" }, | ||
577 | {} | ||
578 | }; | ||
579 | |||
580 | static const struct bin_table bin_net_tr_table[] = { | ||
581 | { CTL_INT, NET_TR_RIF_TIMEOUT, "rif_timeout" }, | ||
582 | {} | ||
583 | }; | ||
584 | |||
585 | |||
586 | static const struct bin_table bin_net_decnet_conf_vars[] = { | ||
587 | { CTL_INT, NET_DECNET_CONF_DEV_FORWARDING, "forwarding" }, | ||
588 | { CTL_INT, NET_DECNET_CONF_DEV_PRIORITY, "priority" }, | ||
589 | { CTL_INT, NET_DECNET_CONF_DEV_T2, "t2" }, | ||
590 | { CTL_INT, NET_DECNET_CONF_DEV_T3, "t3" }, | ||
591 | {} | ||
592 | }; | ||
593 | |||
594 | static const struct bin_table bin_net_decnet_conf[] = { | ||
595 | { CTL_DIR, NET_DECNET_CONF_ETHER, "ethernet", bin_net_decnet_conf_vars }, | ||
596 | { CTL_DIR, NET_DECNET_CONF_GRE, "ipgre", bin_net_decnet_conf_vars }, | ||
597 | { CTL_DIR, NET_DECNET_CONF_X25, "x25", bin_net_decnet_conf_vars }, | ||
598 | { CTL_DIR, NET_DECNET_CONF_PPP, "ppp", bin_net_decnet_conf_vars }, | ||
599 | { CTL_DIR, NET_DECNET_CONF_DDCMP, "ddcmp", bin_net_decnet_conf_vars }, | ||
600 | { CTL_DIR, NET_DECNET_CONF_LOOPBACK, "loopback", bin_net_decnet_conf_vars }, | ||
601 | { CTL_DIR, 0, NULL, bin_net_decnet_conf_vars }, | ||
602 | {} | ||
603 | }; | ||
604 | |||
605 | static const struct bin_table bin_net_decnet_table[] = { | ||
606 | { CTL_DIR, NET_DECNET_CONF, "conf", bin_net_decnet_conf }, | ||
607 | { CTL_DNADR, NET_DECNET_NODE_ADDRESS, "node_address" }, | ||
608 | { CTL_STR, NET_DECNET_NODE_NAME, "node_name" }, | ||
609 | { CTL_STR, NET_DECNET_DEFAULT_DEVICE, "default_device" }, | ||
610 | { CTL_INT, NET_DECNET_TIME_WAIT, "time_wait" }, | ||
611 | { CTL_INT, NET_DECNET_DN_COUNT, "dn_count" }, | ||
612 | { CTL_INT, NET_DECNET_DI_COUNT, "di_count" }, | ||
613 | { CTL_INT, NET_DECNET_DR_COUNT, "dr_count" }, | ||
614 | { CTL_INT, NET_DECNET_DST_GC_INTERVAL, "dst_gc_interval" }, | ||
615 | { CTL_INT, NET_DECNET_NO_FC_MAX_CWND, "no_fc_max_cwnd" }, | ||
616 | { CTL_INT, NET_DECNET_MEM, "decnet_mem" }, | ||
617 | { CTL_INT, NET_DECNET_RMEM, "decnet_rmem" }, | ||
618 | { CTL_INT, NET_DECNET_WMEM, "decnet_wmem" }, | ||
619 | { CTL_INT, NET_DECNET_DEBUG_LEVEL, "debug" }, | ||
620 | {} | ||
621 | }; | ||
622 | |||
623 | static const struct bin_table bin_net_sctp_table[] = { | ||
624 | { CTL_INT, NET_SCTP_RTO_INITIAL, "rto_initial" }, | ||
625 | { CTL_INT, NET_SCTP_RTO_MIN, "rto_min" }, | ||
626 | { CTL_INT, NET_SCTP_RTO_MAX, "rto_max" }, | ||
627 | { CTL_INT, NET_SCTP_RTO_ALPHA, "rto_alpha_exp_divisor" }, | ||
628 | { CTL_INT, NET_SCTP_RTO_BETA, "rto_beta_exp_divisor" }, | ||
629 | { CTL_INT, NET_SCTP_VALID_COOKIE_LIFE, "valid_cookie_life" }, | ||
630 | { CTL_INT, NET_SCTP_ASSOCIATION_MAX_RETRANS, "association_max_retrans" }, | ||
631 | { CTL_INT, NET_SCTP_PATH_MAX_RETRANS, "path_max_retrans" }, | ||
632 | { CTL_INT, NET_SCTP_MAX_INIT_RETRANSMITS, "max_init_retransmits" }, | ||
633 | { CTL_INT, NET_SCTP_HB_INTERVAL, "hb_interval" }, | ||
634 | { CTL_INT, NET_SCTP_PRESERVE_ENABLE, "cookie_preserve_enable" }, | ||
635 | { CTL_INT, NET_SCTP_MAX_BURST, "max_burst" }, | ||
636 | { CTL_INT, NET_SCTP_ADDIP_ENABLE, "addip_enable" }, | ||
637 | { CTL_INT, NET_SCTP_PRSCTP_ENABLE, "prsctp_enable" }, | ||
638 | { CTL_INT, NET_SCTP_SNDBUF_POLICY, "sndbuf_policy" }, | ||
639 | { CTL_INT, NET_SCTP_SACK_TIMEOUT, "sack_timeout" }, | ||
640 | { CTL_INT, NET_SCTP_RCVBUF_POLICY, "rcvbuf_policy" }, | ||
641 | {} | ||
642 | }; | ||
643 | |||
644 | static const struct bin_table bin_net_llc_llc2_timeout_table[] = { | ||
645 | { CTL_INT, NET_LLC2_ACK_TIMEOUT, "ack" }, | ||
646 | { CTL_INT, NET_LLC2_P_TIMEOUT, "p" }, | ||
647 | { CTL_INT, NET_LLC2_REJ_TIMEOUT, "rej" }, | ||
648 | { CTL_INT, NET_LLC2_BUSY_TIMEOUT, "busy" }, | ||
649 | {} | ||
650 | }; | ||
651 | |||
652 | static const struct bin_table bin_net_llc_station_table[] = { | ||
653 | { CTL_INT, NET_LLC_STATION_ACK_TIMEOUT, "ack_timeout" }, | ||
654 | {} | ||
655 | }; | ||
656 | |||
657 | static const struct bin_table bin_net_llc_llc2_table[] = { | ||
658 | { CTL_DIR, NET_LLC2, "timeout", bin_net_llc_llc2_timeout_table }, | ||
659 | {} | ||
660 | }; | ||
661 | |||
662 | static const struct bin_table bin_net_llc_table[] = { | ||
663 | { CTL_DIR, NET_LLC2, "llc2", bin_net_llc_llc2_table }, | ||
664 | { CTL_DIR, NET_LLC_STATION, "station", bin_net_llc_station_table }, | ||
665 | {} | ||
666 | }; | ||
667 | |||
668 | static const struct bin_table bin_net_netfilter_table[] = { | ||
669 | { CTL_INT, NET_NF_CONNTRACK_MAX, "nf_conntrack_max" }, | ||
670 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT "nf_conntrack_tcp_timeout_syn_sent" no longer used */ | ||
671 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV "nf_conntrack_tcp_timeout_syn_recv" no longer used */ | ||
672 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED "nf_conntrack_tcp_timeout_established" no longer used */ | ||
673 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT "nf_conntrack_tcp_timeout_fin_wait" no longer used */ | ||
674 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT "nf_conntrack_tcp_timeout_close_wait" no longer used */ | ||
675 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK "nf_conntrack_tcp_timeout_last_ack" no longer used */ | ||
676 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT "nf_conntrack_tcp_timeout_time_wait" no longer used */ | ||
677 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE "nf_conntrack_tcp_timeout_close" no longer used */ | ||
678 | /* NET_NF_CONNTRACK_UDP_TIMEOUT "nf_conntrack_udp_timeout" no longer used */ | ||
679 | /* NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM "nf_conntrack_udp_timeout_stream" no longer used */ | ||
680 | /* NET_NF_CONNTRACK_ICMP_TIMEOUT "nf_conntrack_icmp_timeout" no longer used */ | ||
681 | /* NET_NF_CONNTRACK_GENERIC_TIMEOUT "nf_conntrack_generic_timeout" no longer used */ | ||
682 | { CTL_INT, NET_NF_CONNTRACK_BUCKETS, "nf_conntrack_buckets" }, | ||
683 | { CTL_INT, NET_NF_CONNTRACK_LOG_INVALID, "nf_conntrack_log_invalid" }, | ||
684 | /* NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS "nf_conntrack_tcp_timeout_max_retrans" no longer used */ | ||
685 | { CTL_INT, NET_NF_CONNTRACK_TCP_LOOSE, "nf_conntrack_tcp_loose" }, | ||
686 | { CTL_INT, NET_NF_CONNTRACK_TCP_BE_LIBERAL, "nf_conntrack_tcp_be_liberal" }, | ||
687 | { CTL_INT, NET_NF_CONNTRACK_TCP_MAX_RETRANS, "nf_conntrack_tcp_max_retrans" }, | ||
688 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED "nf_conntrack_sctp_timeout_closed" no longer used */ | ||
689 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT "nf_conntrack_sctp_timeout_cookie_wait" no longer used */ | ||
690 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED "nf_conntrack_sctp_timeout_cookie_echoed" no longer used */ | ||
691 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED "nf_conntrack_sctp_timeout_established" no longer used */ | ||
692 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT "nf_conntrack_sctp_timeout_shutdown_sent" no longer used */ | ||
693 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD "nf_conntrack_sctp_timeout_shutdown_recd" no longer used */ | ||
694 | /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT "nf_conntrack_sctp_timeout_shutdown_ack_sent" no longer used */ | ||
695 | { CTL_INT, NET_NF_CONNTRACK_COUNT, "nf_conntrack_count" }, | ||
696 | /* NET_NF_CONNTRACK_ICMPV6_TIMEOUT "nf_conntrack_icmpv6_timeout" no longer used */ | ||
697 | /* NET_NF_CONNTRACK_FRAG6_TIMEOUT "nf_conntrack_frag6_timeout" no longer used */ | ||
698 | { CTL_INT, NET_NF_CONNTRACK_FRAG6_LOW_THRESH, "nf_conntrack_frag6_low_thresh" }, | ||
699 | { CTL_INT, NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, "nf_conntrack_frag6_high_thresh" }, | ||
700 | { CTL_INT, NET_NF_CONNTRACK_CHECKSUM, "nf_conntrack_checksum" }, | ||
701 | |||
702 | {} | ||
703 | }; | ||
704 | |||
705 | static const struct bin_table bin_net_irda_table[] = { | ||
706 | { CTL_INT, NET_IRDA_DISCOVERY, "discovery" }, | ||
707 | { CTL_STR, NET_IRDA_DEVNAME, "devname" }, | ||
708 | { CTL_INT, NET_IRDA_DEBUG, "debug" }, | ||
709 | { CTL_INT, NET_IRDA_FAST_POLL, "fast_poll_increase" }, | ||
710 | { CTL_INT, NET_IRDA_DISCOVERY_SLOTS, "discovery_slots" }, | ||
711 | { CTL_INT, NET_IRDA_DISCOVERY_TIMEOUT, "discovery_timeout" }, | ||
712 | { CTL_INT, NET_IRDA_SLOT_TIMEOUT, "slot_timeout" }, | ||
713 | { CTL_INT, NET_IRDA_MAX_BAUD_RATE, "max_baud_rate" }, | ||
714 | { CTL_INT, NET_IRDA_MIN_TX_TURN_TIME, "min_tx_turn_time" }, | ||
715 | { CTL_INT, NET_IRDA_MAX_TX_DATA_SIZE, "max_tx_data_size" }, | ||
716 | { CTL_INT, NET_IRDA_MAX_TX_WINDOW, "max_tx_window" }, | ||
717 | { CTL_INT, NET_IRDA_MAX_NOREPLY_TIME, "max_noreply_time" }, | ||
718 | { CTL_INT, NET_IRDA_WARN_NOREPLY_TIME, "warn_noreply_time" }, | ||
719 | { CTL_INT, NET_IRDA_LAP_KEEPALIVE_TIME, "lap_keepalive_time" }, | ||
720 | {} | ||
721 | }; | ||
722 | |||
723 | static const struct bin_table bin_net_table[] = { | ||
724 | { CTL_DIR, NET_CORE, "core", bin_net_core_table }, | ||
725 | /* NET_ETHER not used */ | ||
726 | /* NET_802 not used */ | ||
727 | { CTL_DIR, NET_UNIX, "unix", bin_net_unix_table }, | ||
728 | { CTL_DIR, NET_IPV4, "ipv4", bin_net_ipv4_table }, | ||
729 | { CTL_DIR, NET_IPX, "ipx", bin_net_ipx_table }, | ||
730 | { CTL_DIR, NET_ATALK, "appletalk", bin_net_atalk_table }, | ||
731 | { CTL_DIR, NET_NETROM, "netrom", bin_net_netrom_table }, | ||
732 | { CTL_DIR, NET_AX25, "ax25", bin_net_ax25_table }, | ||
733 | /* NET_BRIDGE "bridge" no longer used */ | ||
734 | { CTL_DIR, NET_ROSE, "rose", bin_net_rose_table }, | ||
735 | { CTL_DIR, NET_IPV6, "ipv6", bin_net_ipv6_table }, | ||
736 | { CTL_DIR, NET_X25, "x25", bin_net_x25_table }, | ||
737 | { CTL_DIR, NET_TR, "token-ring", bin_net_tr_table }, | ||
738 | { CTL_DIR, NET_DECNET, "decnet", bin_net_decnet_table }, | ||
739 | /* NET_ECONET not used */ | ||
740 | { CTL_DIR, NET_SCTP, "sctp", bin_net_sctp_table }, | ||
741 | { CTL_DIR, NET_LLC, "llc", bin_net_llc_table }, | ||
742 | { CTL_DIR, NET_NETFILTER, "netfilter", bin_net_netfilter_table }, | ||
743 | /* NET_DCCP "dccp" no longer used */ | ||
744 | { CTL_DIR, NET_IRDA, "irda", bin_net_irda_table }, | ||
745 | { CTL_INT, 2089, "nf_conntrack_max" }, | ||
746 | {} | ||
747 | }; | ||
748 | |||
749 | static const struct bin_table bin_fs_quota_table[] = { | ||
750 | { CTL_INT, FS_DQ_LOOKUPS, "lookups" }, | ||
751 | { CTL_INT, FS_DQ_DROPS, "drops" }, | ||
752 | { CTL_INT, FS_DQ_READS, "reads" }, | ||
753 | { CTL_INT, FS_DQ_WRITES, "writes" }, | ||
754 | { CTL_INT, FS_DQ_CACHE_HITS, "cache_hits" }, | ||
755 | { CTL_INT, FS_DQ_ALLOCATED, "allocated_dquots" }, | ||
756 | { CTL_INT, FS_DQ_FREE, "free_dquots" }, | ||
757 | { CTL_INT, FS_DQ_SYNCS, "syncs" }, | ||
758 | { CTL_INT, FS_DQ_WARNINGS, "warnings" }, | ||
759 | {} | ||
760 | }; | ||
761 | |||
762 | static const struct bin_table bin_fs_xfs_table[] = { | ||
763 | { CTL_INT, XFS_SGID_INHERIT, "irix_sgid_inherit" }, | ||
764 | { CTL_INT, XFS_SYMLINK_MODE, "irix_symlink_mode" }, | ||
765 | { CTL_INT, XFS_PANIC_MASK, "panic_mask" }, | ||
766 | |||
767 | { CTL_INT, XFS_ERRLEVEL, "error_level" }, | ||
768 | { CTL_INT, XFS_SYNCD_TIMER, "xfssyncd_centisecs" }, | ||
769 | { CTL_INT, XFS_INHERIT_SYNC, "inherit_sync" }, | ||
770 | { CTL_INT, XFS_INHERIT_NODUMP, "inherit_nodump" }, | ||
771 | { CTL_INT, XFS_INHERIT_NOATIME, "inherit_noatime" }, | ||
772 | { CTL_INT, XFS_BUF_TIMER, "xfsbufd_centisecs" }, | ||
773 | { CTL_INT, XFS_BUF_AGE, "age_buffer_centisecs" }, | ||
774 | { CTL_INT, XFS_INHERIT_NOSYM, "inherit_nosymlinks" }, | ||
775 | { CTL_INT, XFS_ROTORSTEP, "rotorstep" }, | ||
776 | { CTL_INT, XFS_INHERIT_NODFRG, "inherit_nodefrag" }, | ||
777 | { CTL_INT, XFS_FILESTREAM_TIMER, "filestream_centisecs" }, | ||
778 | { CTL_INT, XFS_STATS_CLEAR, "stats_clear" }, | ||
779 | {} | ||
780 | }; | ||
781 | |||
782 | static const struct bin_table bin_fs_ocfs2_nm_table[] = { | ||
783 | { CTL_STR, 1, "hb_ctl_path" }, | ||
784 | {} | ||
785 | }; | ||
786 | |||
787 | static const struct bin_table bin_fs_ocfs2_table[] = { | ||
788 | { CTL_DIR, 1, "nm", bin_fs_ocfs2_nm_table }, | ||
789 | {} | ||
790 | }; | ||
791 | |||
792 | static const struct bin_table bin_inotify_table[] = { | ||
793 | { CTL_INT, INOTIFY_MAX_USER_INSTANCES, "max_user_instances" }, | ||
794 | { CTL_INT, INOTIFY_MAX_USER_WATCHES, "max_user_watches" }, | ||
795 | { CTL_INT, INOTIFY_MAX_QUEUED_EVENTS, "max_queued_events" }, | ||
796 | {} | ||
797 | }; | ||
798 | |||
799 | static const struct bin_table bin_fs_table[] = { | ||
800 | { CTL_INT, FS_NRINODE, "inode-nr" }, | ||
801 | { CTL_INT, FS_STATINODE, "inode-state" }, | ||
802 | /* FS_MAXINODE unused */ | ||
803 | /* FS_NRDQUOT unused */ | ||
804 | /* FS_MAXDQUOT unused */ | ||
805 | /* FS_NRFILE "file-nr" no longer used */ | ||
806 | { CTL_INT, FS_MAXFILE, "file-max" }, | ||
807 | { CTL_INT, FS_DENTRY, "dentry-state" }, | ||
808 | /* FS_NRSUPER unused */ | ||
809 | /* FS_MAXUPSER unused */ | ||
810 | { CTL_INT, FS_OVERFLOWUID, "overflowuid" }, | ||
811 | { CTL_INT, FS_OVERFLOWGID, "overflowgid" }, | ||
812 | { CTL_INT, FS_LEASES, "leases-enable" }, | ||
813 | { CTL_INT, FS_DIR_NOTIFY, "dir-notify-enable" }, | ||
814 | { CTL_INT, FS_LEASE_TIME, "lease-break-time" }, | ||
815 | { CTL_DIR, FS_DQSTATS, "quota", bin_fs_quota_table }, | ||
816 | { CTL_DIR, FS_XFS, "xfs", bin_fs_xfs_table }, | ||
817 | { CTL_ULONG, FS_AIO_NR, "aio-nr" }, | ||
818 | { CTL_ULONG, FS_AIO_MAX_NR, "aio-max-nr" }, | ||
819 | { CTL_DIR, FS_INOTIFY, "inotify", bin_inotify_table }, | ||
820 | { CTL_DIR, FS_OCFS2, "ocfs2", bin_fs_ocfs2_table }, | ||
821 | { CTL_INT, KERN_SETUID_DUMPABLE, "suid_dumpable" }, | ||
822 | {} | ||
823 | }; | ||
824 | |||
825 | static const struct bin_table bin_ipmi_table[] = { | ||
826 | { CTL_INT, DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" }, | ||
827 | {} | ||
828 | }; | ||
829 | |||
830 | static const struct bin_table bin_mac_hid_files[] = { | ||
831 | /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */ | ||
832 | /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */ | ||
833 | { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON_EMULATION, "mouse_button_emulation" }, | ||
834 | { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, "mouse_button2_keycode" }, | ||
835 | { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, "mouse_button3_keycode" }, | ||
836 | /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */ | ||
837 | {} | ||
838 | }; | ||
839 | |||
840 | static const struct bin_table bin_raid_table[] = { | ||
841 | { CTL_INT, DEV_RAID_SPEED_LIMIT_MIN, "speed_limit_min" }, | ||
842 | { CTL_INT, DEV_RAID_SPEED_LIMIT_MAX, "speed_limit_max" }, | ||
843 | {} | ||
844 | }; | ||
845 | |||
846 | static const struct bin_table bin_scsi_table[] = { | ||
847 | { CTL_INT, DEV_SCSI_LOGGING_LEVEL, "logging_level" }, | ||
848 | {} | ||
849 | }; | ||
850 | |||
851 | static const struct bin_table bin_dev_table[] = { | ||
852 | /* DEV_CDROM "cdrom" no longer used */ | ||
853 | /* DEV_HWMON unused */ | ||
854 | /* DEV_PARPORT "parport" no longer used */ | ||
855 | { CTL_DIR, DEV_RAID, "raid", bin_raid_table }, | ||
856 | { CTL_DIR, DEV_MAC_HID, "mac_hid", bin_mac_hid_files }, | ||
857 | { CTL_DIR, DEV_SCSI, "scsi", bin_scsi_table }, | ||
858 | { CTL_DIR, DEV_IPMI, "ipmi", bin_ipmi_table }, | ||
859 | {} | ||
860 | }; | ||
861 | |||
862 | static const struct bin_table bin_bus_isa_table[] = { | ||
863 | { CTL_INT, BUS_ISA_MEM_BASE, "membase" }, | ||
864 | { CTL_INT, BUS_ISA_PORT_BASE, "portbase" }, | ||
865 | { CTL_INT, BUS_ISA_PORT_SHIFT, "portshift" }, | ||
866 | {} | ||
867 | }; | ||
868 | |||
869 | static const struct bin_table bin_bus_table[] = { | ||
870 | { CTL_DIR, CTL_BUS_ISA, "isa", bin_bus_isa_table }, | ||
871 | {} | ||
872 | }; | ||
873 | |||
874 | |||
875 | static const struct bin_table bin_s390dbf_table[] = { | ||
876 | { CTL_INT, 5678 /* CTL_S390DBF_STOPPABLE */, "debug_stoppable" }, | ||
877 | { CTL_INT, 5679 /* CTL_S390DBF_ACTIVE */, "debug_active" }, | ||
878 | {} | ||
879 | }; | ||
880 | |||
881 | static const struct bin_table bin_sunrpc_table[] = { | ||
882 | /* CTL_RPCDEBUG "rpc_debug" no longer used */ | ||
883 | /* CTL_NFSDEBUG "nfs_debug" no longer used */ | ||
884 | /* CTL_NFSDDEBUG "nfsd_debug" no longer used */ | ||
885 | /* CTL_NLMDEBUG "nlm_debug" no longer used */ | ||
886 | |||
887 | { CTL_INT, CTL_SLOTTABLE_UDP, "udp_slot_table_entries" }, | ||
888 | { CTL_INT, CTL_SLOTTABLE_TCP, "tcp_slot_table_entries" }, | ||
889 | { CTL_INT, CTL_MIN_RESVPORT, "min_resvport" }, | ||
890 | { CTL_INT, CTL_MAX_RESVPORT, "max_resvport" }, | ||
891 | {} | ||
892 | }; | ||
893 | |||
894 | static const struct bin_table bin_pm_table[] = { | ||
895 | /* frv specific */ | ||
896 | /* 1 == CTL_PM_SUSPEND "suspend" no longer used" */ | ||
897 | { CTL_INT, 2 /* CTL_PM_CMODE */, "cmode" }, | ||
898 | { CTL_INT, 3 /* CTL_PM_P0 */, "p0" }, | ||
899 | { CTL_INT, 4 /* CTL_PM_CM */, "cm" }, | ||
900 | {} | ||
901 | }; | ||
902 | |||
903 | static const struct bin_table bin_root_table[] = { | ||
904 | { CTL_DIR, CTL_KERN, "kernel", bin_kern_table }, | ||
905 | { CTL_DIR, CTL_VM, "vm", bin_vm_table }, | ||
906 | { CTL_DIR, CTL_NET, "net", bin_net_table }, | ||
907 | /* CTL_PROC not used */ | ||
908 | { CTL_DIR, CTL_FS, "fs", bin_fs_table }, | ||
909 | /* CTL_DEBUG "debug" no longer used */ | ||
910 | { CTL_DIR, CTL_DEV, "dev", bin_dev_table }, | ||
911 | { CTL_DIR, CTL_BUS, "bus", bin_bus_table }, | ||
912 | { CTL_DIR, CTL_ABI, "abi" }, | ||
913 | /* CTL_CPU not used */ | ||
914 | /* CTL_ARLAN "arlan" no longer used */ | ||
915 | { CTL_DIR, CTL_S390DBF, "s390dbf", bin_s390dbf_table }, | ||
916 | { CTL_DIR, CTL_SUNRPC, "sunrpc", bin_sunrpc_table }, | ||
917 | { CTL_DIR, CTL_PM, "pm", bin_pm_table }, | ||
918 | {} | ||
919 | }; | ||
920 | |||
921 | static ssize_t bin_dir(struct file *file, | ||
922 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
923 | { | ||
924 | return -ENOTDIR; | ||
925 | } | ||
926 | |||
927 | |||
928 | static ssize_t bin_string(struct file *file, | ||
929 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
930 | { | ||
931 | ssize_t result, copied = 0; | ||
932 | |||
933 | if (oldval && oldlen) { | ||
934 | char __user *lastp; | ||
935 | loff_t pos = 0; | ||
936 | int ch; | ||
937 | |||
938 | result = vfs_read(file, oldval, oldlen, &pos); | ||
939 | if (result < 0) | ||
940 | goto out; | ||
941 | |||
942 | copied = result; | ||
943 | lastp = oldval + copied - 1; | ||
944 | |||
945 | result = -EFAULT; | ||
946 | if (get_user(ch, lastp)) | ||
947 | goto out; | ||
948 | |||
949 | /* Trim off the trailing newline */ | ||
950 | if (ch == '\n') { | ||
951 | result = -EFAULT; | ||
952 | if (put_user('\0', lastp)) | ||
953 | goto out; | ||
954 | copied -= 1; | ||
955 | } | ||
956 | } | ||
957 | |||
958 | if (newval && newlen) { | ||
959 | loff_t pos = 0; | ||
960 | |||
961 | result = vfs_write(file, newval, newlen, &pos); | ||
962 | if (result < 0) | ||
963 | goto out; | ||
964 | } | ||
965 | |||
966 | result = copied; | ||
967 | out: | ||
968 | return result; | ||
969 | } | ||
970 | |||
971 | static ssize_t bin_intvec(struct file *file, | ||
972 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
973 | { | ||
974 | mm_segment_t old_fs = get_fs(); | ||
975 | ssize_t copied = 0; | ||
976 | char *buffer; | ||
977 | ssize_t result; | ||
978 | |||
979 | result = -ENOMEM; | ||
980 | buffer = kmalloc(BUFSZ, GFP_KERNEL); | ||
981 | if (!buffer) | ||
982 | goto out; | ||
983 | |||
984 | if (oldval && oldlen) { | ||
985 | unsigned __user *vec = oldval; | ||
986 | size_t length = oldlen / sizeof(*vec); | ||
987 | loff_t pos = 0; | ||
988 | char *str, *end; | ||
989 | int i; | ||
990 | |||
991 | set_fs(KERNEL_DS); | ||
992 | result = vfs_read(file, buffer, BUFSZ - 1, &pos); | ||
993 | set_fs(old_fs); | ||
994 | if (result < 0) | ||
995 | goto out_kfree; | ||
996 | |||
997 | str = buffer; | ||
998 | end = str + result; | ||
999 | *end++ = '\0'; | ||
1000 | for (i = 0; i < length; i++) { | ||
1001 | unsigned long value; | ||
1002 | |||
1003 | value = simple_strtoul(str, &str, 10); | ||
1004 | while (isspace(*str)) | ||
1005 | str++; | ||
1006 | |||
1007 | result = -EFAULT; | ||
1008 | if (put_user(value, vec + i)) | ||
1009 | goto out_kfree; | ||
1010 | |||
1011 | copied += sizeof(*vec); | ||
1012 | if (!isdigit(*str)) | ||
1013 | break; | ||
1014 | } | ||
1015 | } | ||
1016 | |||
1017 | if (newval && newlen) { | ||
1018 | unsigned __user *vec = newval; | ||
1019 | size_t length = newlen / sizeof(*vec); | ||
1020 | loff_t pos = 0; | ||
1021 | char *str, *end; | ||
1022 | int i; | ||
1023 | |||
1024 | str = buffer; | ||
1025 | end = str + BUFSZ; | ||
1026 | for (i = 0; i < length; i++) { | ||
1027 | unsigned long value; | ||
1028 | |||
1029 | result = -EFAULT; | ||
1030 | if (get_user(value, vec + i)) | ||
1031 | goto out_kfree; | ||
1032 | |||
1033 | str += snprintf(str, end - str, "%lu\t", value); | ||
1034 | } | ||
1035 | |||
1036 | set_fs(KERNEL_DS); | ||
1037 | result = vfs_write(file, buffer, str - buffer, &pos); | ||
1038 | set_fs(old_fs); | ||
1039 | if (result < 0) | ||
1040 | goto out_kfree; | ||
1041 | } | ||
1042 | result = copied; | ||
1043 | out_kfree: | ||
1044 | kfree(buffer); | ||
1045 | out: | ||
1046 | return result; | ||
1047 | } | ||
1048 | |||
1049 | static ssize_t bin_ulongvec(struct file *file, | ||
1050 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
1051 | { | ||
1052 | mm_segment_t old_fs = get_fs(); | ||
1053 | ssize_t copied = 0; | ||
1054 | char *buffer; | ||
1055 | ssize_t result; | ||
1056 | |||
1057 | result = -ENOMEM; | ||
1058 | buffer = kmalloc(BUFSZ, GFP_KERNEL); | ||
1059 | if (!buffer) | ||
1060 | goto out; | ||
1061 | |||
1062 | if (oldval && oldlen) { | ||
1063 | unsigned long __user *vec = oldval; | ||
1064 | size_t length = oldlen / sizeof(*vec); | ||
1065 | loff_t pos = 0; | ||
1066 | char *str, *end; | ||
1067 | int i; | ||
1068 | |||
1069 | set_fs(KERNEL_DS); | ||
1070 | result = vfs_read(file, buffer, BUFSZ - 1, &pos); | ||
1071 | set_fs(old_fs); | ||
1072 | if (result < 0) | ||
1073 | goto out_kfree; | ||
1074 | |||
1075 | str = buffer; | ||
1076 | end = str + result; | ||
1077 | *end++ = '\0'; | ||
1078 | for (i = 0; i < length; i++) { | ||
1079 | unsigned long value; | ||
1080 | |||
1081 | value = simple_strtoul(str, &str, 10); | ||
1082 | while (isspace(*str)) | ||
1083 | str++; | ||
1084 | |||
1085 | result = -EFAULT; | ||
1086 | if (put_user(value, vec + i)) | ||
1087 | goto out_kfree; | ||
1088 | |||
1089 | copied += sizeof(*vec); | ||
1090 | if (!isdigit(*str)) | ||
1091 | break; | ||
1092 | } | ||
1093 | } | ||
1094 | |||
1095 | if (newval && newlen) { | ||
1096 | unsigned long __user *vec = newval; | ||
1097 | size_t length = newlen / sizeof(*vec); | ||
1098 | loff_t pos = 0; | ||
1099 | char *str, *end; | ||
1100 | int i; | ||
1101 | |||
1102 | str = buffer; | ||
1103 | end = str + BUFSZ; | ||
1104 | for (i = 0; i < length; i++) { | ||
1105 | unsigned long value; | ||
1106 | |||
1107 | result = -EFAULT; | ||
1108 | if (get_user(value, vec + i)) | ||
1109 | goto out_kfree; | ||
1110 | |||
1111 | str += snprintf(str, end - str, "%lu\t", value); | ||
1112 | } | ||
1113 | |||
1114 | set_fs(KERNEL_DS); | ||
1115 | result = vfs_write(file, buffer, str - buffer, &pos); | ||
1116 | set_fs(old_fs); | ||
1117 | if (result < 0) | ||
1118 | goto out_kfree; | ||
1119 | } | ||
1120 | result = copied; | ||
1121 | out_kfree: | ||
1122 | kfree(buffer); | ||
1123 | out: | ||
1124 | return result; | ||
1125 | } | ||
1126 | |||
1127 | static unsigned hex_value(int ch) | ||
1128 | { | ||
1129 | return isdigit(ch) ? ch - '0' : ((ch | 0x20) - 'a') + 10; | ||
1130 | } | ||
1131 | |||
1132 | static ssize_t bin_uuid(struct file *file, | ||
1133 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
1134 | { | ||
1135 | mm_segment_t old_fs = get_fs(); | ||
1136 | ssize_t result, copied = 0; | ||
1137 | |||
1138 | /* Only supports reads */ | ||
1139 | if (oldval && oldlen) { | ||
1140 | loff_t pos = 0; | ||
1141 | char buf[40], *str = buf; | ||
1142 | unsigned char uuid[16]; | ||
1143 | int i; | ||
1144 | |||
1145 | set_fs(KERNEL_DS); | ||
1146 | result = vfs_read(file, buf, sizeof(buf) - 1, &pos); | ||
1147 | set_fs(old_fs); | ||
1148 | if (result < 0) | ||
1149 | goto out; | ||
1150 | |||
1151 | buf[result] = '\0'; | ||
1152 | |||
1153 | /* Convert the uuid to from a string to binary */ | ||
1154 | for (i = 0; i < 16; i++) { | ||
1155 | result = -EIO; | ||
1156 | if (!isxdigit(str[0]) || !isxdigit(str[1])) | ||
1157 | goto out; | ||
1158 | |||
1159 | uuid[i] = (hex_value(str[0]) << 4) | hex_value(str[1]); | ||
1160 | str += 2; | ||
1161 | if (*str == '-') | ||
1162 | str++; | ||
1163 | } | ||
1164 | |||
1165 | if (oldlen > 16) | ||
1166 | oldlen = 16; | ||
1167 | |||
1168 | result = -EFAULT; | ||
1169 | if (copy_to_user(oldval, uuid, oldlen)) | ||
1170 | goto out; | ||
1171 | |||
1172 | copied = oldlen; | ||
1173 | } | ||
1174 | result = copied; | ||
1175 | out: | ||
1176 | return result; | ||
1177 | } | ||
1178 | |||
1179 | static ssize_t bin_dn_node_address(struct file *file, | ||
1180 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
1181 | { | ||
1182 | mm_segment_t old_fs = get_fs(); | ||
1183 | ssize_t result, copied = 0; | ||
1184 | |||
1185 | if (oldval && oldlen) { | ||
1186 | loff_t pos = 0; | ||
1187 | char buf[15], *nodep; | ||
1188 | unsigned long area, node; | ||
1189 | __le16 dnaddr; | ||
1190 | |||
1191 | set_fs(KERNEL_DS); | ||
1192 | result = vfs_read(file, buf, sizeof(buf) - 1, &pos); | ||
1193 | set_fs(old_fs); | ||
1194 | if (result < 0) | ||
1195 | goto out; | ||
1196 | |||
1197 | buf[result] = '\0'; | ||
1198 | |||
1199 | /* Convert the decnet addresss to binary */ | ||
1200 | result = -EIO; | ||
1201 | nodep = strchr(buf, '.') + 1; | ||
1202 | if (!nodep) | ||
1203 | goto out; | ||
1204 | |||
1205 | area = simple_strtoul(buf, NULL, 10); | ||
1206 | node = simple_strtoul(nodep, NULL, 10); | ||
1207 | |||
1208 | result = -EIO; | ||
1209 | if ((area > 63)||(node > 1023)) | ||
1210 | goto out; | ||
1211 | |||
1212 | dnaddr = cpu_to_le16((area << 10) | node); | ||
1213 | |||
1214 | result = -EFAULT; | ||
1215 | if (put_user(dnaddr, (__le16 __user *)oldval)) | ||
1216 | goto out; | ||
1217 | |||
1218 | copied = sizeof(dnaddr); | ||
1219 | } | ||
1220 | |||
1221 | if (newval && newlen) { | ||
1222 | loff_t pos = 0; | ||
1223 | __le16 dnaddr; | ||
1224 | char buf[15]; | ||
1225 | int len; | ||
1226 | |||
1227 | result = -EINVAL; | ||
1228 | if (newlen != sizeof(dnaddr)) | ||
1229 | goto out; | ||
1230 | |||
1231 | result = -EFAULT; | ||
1232 | if (get_user(dnaddr, (__le16 __user *)newval)) | ||
1233 | goto out; | ||
1234 | |||
1235 | len = snprintf(buf, sizeof(buf), "%hu.%hu", | ||
1236 | le16_to_cpu(dnaddr) >> 10, | ||
1237 | le16_to_cpu(dnaddr) & 0x3ff); | ||
1238 | |||
1239 | set_fs(KERNEL_DS); | ||
1240 | result = vfs_write(file, buf, len, &pos); | ||
1241 | set_fs(old_fs); | ||
1242 | if (result < 0) | ||
1243 | goto out; | ||
1244 | } | ||
1245 | |||
1246 | result = copied; | ||
1247 | out: | ||
1248 | return result; | ||
1249 | } | ||
1250 | |||
1251 | static const struct bin_table *get_sysctl(const int *name, int nlen, char *path) | ||
1252 | { | ||
1253 | const struct bin_table *table = &bin_root_table[0]; | ||
1254 | int ctl_name; | ||
1255 | |||
1256 | /* The binary sysctl tables have a small maximum depth so | ||
1257 | * there is no danger of overflowing our path as it PATH_MAX | ||
1258 | * bytes long. | ||
1259 | */ | ||
1260 | memcpy(path, "sys/", 4); | ||
1261 | path += 4; | ||
1262 | |||
1263 | repeat: | ||
1264 | if (!nlen) | ||
1265 | return ERR_PTR(-ENOTDIR); | ||
1266 | ctl_name = *name; | ||
1267 | name++; | ||
1268 | nlen--; | ||
1269 | for ( ; table->convert; table++) { | ||
1270 | int len = 0; | ||
1271 | |||
1272 | /* | ||
1273 | * For a wild card entry map from ifindex to network | ||
1274 | * device name. | ||
1275 | */ | ||
1276 | if (!table->ctl_name) { | ||
1277 | #ifdef CONFIG_NET | ||
1278 | struct net *net = current->nsproxy->net_ns; | ||
1279 | struct net_device *dev; | ||
1280 | dev = dev_get_by_index(net, ctl_name); | ||
1281 | if (dev) { | ||
1282 | len = strlen(dev->name); | ||
1283 | memcpy(path, dev->name, len); | ||
1284 | dev_put(dev); | ||
1285 | } | ||
1286 | #endif | ||
1287 | /* Use the well known sysctl number to proc name mapping */ | ||
1288 | } else if (ctl_name == table->ctl_name) { | ||
1289 | len = strlen(table->procname); | ||
1290 | memcpy(path, table->procname, len); | ||
1291 | } | ||
1292 | if (len) { | ||
1293 | path += len; | ||
1294 | if (table->child) { | ||
1295 | *path++ = '/'; | ||
1296 | table = table->child; | ||
1297 | goto repeat; | ||
1298 | } | ||
1299 | *path = '\0'; | ||
1300 | return table; | ||
1301 | } | ||
1302 | } | ||
1303 | return ERR_PTR(-ENOTDIR); | ||
1304 | } | ||
1305 | |||
1306 | static char *sysctl_getname(const int *name, int nlen, const struct bin_table **tablep) | ||
1307 | { | ||
1308 | char *tmp, *result; | ||
1309 | |||
1310 | result = ERR_PTR(-ENOMEM); | ||
1311 | tmp = __getname(); | ||
1312 | if (tmp) { | ||
1313 | const struct bin_table *table = get_sysctl(name, nlen, tmp); | ||
1314 | result = tmp; | ||
1315 | *tablep = table; | ||
1316 | if (IS_ERR(table)) { | ||
1317 | __putname(tmp); | ||
1318 | result = ERR_CAST(table); | ||
1319 | } | ||
1320 | } | ||
1321 | return result; | ||
1322 | } | ||
1323 | |||
1324 | static ssize_t binary_sysctl(const int *name, int nlen, | ||
1325 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
1326 | { | ||
1327 | const struct bin_table *table = NULL; | ||
1328 | struct nameidata nd; | ||
1329 | struct vfsmount *mnt; | ||
1330 | struct file *file; | ||
1331 | ssize_t result; | ||
1332 | char *pathname; | ||
1333 | int flags; | ||
1334 | int acc_mode, fmode; | ||
1335 | |||
1336 | pathname = sysctl_getname(name, nlen, &table); | ||
1337 | result = PTR_ERR(pathname); | ||
1338 | if (IS_ERR(pathname)) | ||
1339 | goto out; | ||
1340 | |||
1341 | /* How should the sysctl be accessed? */ | ||
1342 | if (oldval && oldlen && newval && newlen) { | ||
1343 | flags = O_RDWR; | ||
1344 | acc_mode = MAY_READ | MAY_WRITE; | ||
1345 | fmode = FMODE_READ | FMODE_WRITE; | ||
1346 | } else if (newval && newlen) { | ||
1347 | flags = O_WRONLY; | ||
1348 | acc_mode = MAY_WRITE; | ||
1349 | fmode = FMODE_WRITE; | ||
1350 | } else if (oldval && oldlen) { | ||
1351 | flags = O_RDONLY; | ||
1352 | acc_mode = MAY_READ; | ||
1353 | fmode = FMODE_READ; | ||
1354 | } else { | ||
1355 | result = 0; | ||
1356 | goto out_putname; | ||
1357 | } | ||
1358 | |||
1359 | mnt = current->nsproxy->pid_ns->proc_mnt; | ||
1360 | result = vfs_path_lookup(mnt->mnt_root, mnt, pathname, 0, &nd); | ||
1361 | if (result) | ||
1362 | goto out_putname; | ||
1363 | |||
1364 | result = may_open(&nd.path, acc_mode, fmode); | ||
1365 | if (result) | ||
1366 | goto out_putpath; | ||
1367 | |||
1368 | file = dentry_open(nd.path.dentry, nd.path.mnt, flags, current_cred()); | ||
1369 | result = PTR_ERR(file); | ||
1370 | if (IS_ERR(file)) | ||
1371 | goto out_putname; | ||
1372 | |||
1373 | result = table->convert(file, oldval, oldlen, newval, newlen); | ||
1374 | |||
1375 | fput(file); | ||
1376 | out_putname: | ||
1377 | putname(pathname); | ||
1378 | out: | ||
1379 | return result; | ||
1380 | |||
1381 | out_putpath: | ||
1382 | path_put(&nd.path); | ||
1383 | goto out_putname; | ||
1384 | } | ||
1385 | |||
1386 | |||
1387 | #else /* CONFIG_SYSCTL_SYSCALL */ | ||
1388 | |||
1389 | static ssize_t binary_sysctl(const int *name, int nlen, | ||
1390 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
1391 | { | ||
1392 | return -ENOSYS; | ||
1393 | } | ||
1394 | |||
1395 | #endif /* CONFIG_SYSCTL_SYSCALL */ | ||
1396 | |||
1397 | |||
1398 | static void deprecated_sysctl_warning(const int *name, int nlen) | ||
1399 | { | ||
1400 | int i; | ||
1401 | |||
1402 | if (printk_ratelimit()) { | ||
1403 | printk(KERN_INFO | ||
1404 | "warning: process `%s' used the deprecated sysctl " | ||
1405 | "system call with ", current->comm); | ||
1406 | for (i = 0; i < nlen; i++) | ||
1407 | printk("%d.", name[i]); | ||
1408 | printk("\n"); | ||
1409 | } | ||
1410 | return; | ||
1411 | } | ||
1412 | |||
1413 | static ssize_t do_sysctl(int __user *args_name, int nlen, | ||
1414 | void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) | ||
1415 | { | ||
1416 | int name[CTL_MAXNAME]; | ||
1417 | int i; | ||
1418 | |||
1419 | /* Check args->nlen. */ | ||
1420 | if (nlen < 0 || nlen > CTL_MAXNAME) | ||
1421 | return -ENOTDIR; | ||
1422 | /* Read in the sysctl name for simplicity */ | ||
1423 | for (i = 0; i < nlen; i++) | ||
1424 | if (get_user(name[i], args_name + i)) | ||
1425 | return -EFAULT; | ||
1426 | |||
1427 | deprecated_sysctl_warning(name, nlen); | ||
1428 | |||
1429 | return binary_sysctl(name, nlen, oldval, oldlen, newval, newlen); | ||
1430 | } | ||
1431 | |||
1432 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | ||
1433 | { | ||
1434 | struct __sysctl_args tmp; | ||
1435 | size_t oldlen = 0; | ||
1436 | ssize_t result; | ||
1437 | |||
1438 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
1439 | return -EFAULT; | ||
1440 | |||
1441 | if (tmp.oldval && !tmp.oldlenp) | ||
1442 | return -EFAULT; | ||
1443 | |||
1444 | if (tmp.oldlenp && get_user(oldlen, tmp.oldlenp)) | ||
1445 | return -EFAULT; | ||
1446 | |||
1447 | result = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, oldlen, | ||
1448 | tmp.newval, tmp.newlen); | ||
1449 | |||
1450 | if (result >= 0) { | ||
1451 | oldlen = result; | ||
1452 | result = 0; | ||
1453 | } | ||
1454 | |||
1455 | if (tmp.oldlenp && put_user(oldlen, tmp.oldlenp)) | ||
1456 | return -EFAULT; | ||
1457 | |||
1458 | return result; | ||
1459 | } | ||
1460 | |||
1461 | |||
1462 | #ifdef CONFIG_COMPAT | ||
1463 | #include <asm/compat.h> | ||
1464 | |||
1465 | struct compat_sysctl_args { | ||
1466 | compat_uptr_t name; | ||
1467 | int nlen; | ||
1468 | compat_uptr_t oldval; | ||
1469 | compat_uptr_t oldlenp; | ||
1470 | compat_uptr_t newval; | ||
1471 | compat_size_t newlen; | ||
1472 | compat_ulong_t __unused[4]; | ||
1473 | }; | ||
1474 | |||
1475 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args) | ||
1476 | { | ||
1477 | struct compat_sysctl_args tmp; | ||
1478 | compat_size_t __user *compat_oldlenp; | ||
1479 | size_t oldlen = 0; | ||
1480 | ssize_t result; | ||
1481 | |||
1482 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
1483 | return -EFAULT; | ||
1484 | |||
1485 | if (tmp.oldval && !tmp.oldlenp) | ||
1486 | return -EFAULT; | ||
1487 | |||
1488 | compat_oldlenp = compat_ptr(tmp.oldlenp); | ||
1489 | if (compat_oldlenp && get_user(oldlen, compat_oldlenp)) | ||
1490 | return -EFAULT; | ||
1491 | |||
1492 | result = do_sysctl(compat_ptr(tmp.name), tmp.nlen, | ||
1493 | compat_ptr(tmp.oldval), oldlen, | ||
1494 | compat_ptr(tmp.newval), tmp.newlen); | ||
1495 | |||
1496 | if (result >= 0) { | ||
1497 | oldlen = result; | ||
1498 | result = 0; | ||
1499 | } | ||
1500 | |||
1501 | if (compat_oldlenp && put_user(oldlen, compat_oldlenp)) | ||
1502 | return -EFAULT; | ||
1503 | |||
1504 | return result; | ||
1505 | } | ||
1506 | |||
1507 | #endif /* CONFIG_COMPAT */ | ||
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c index b6e7aaea4604..04cdcf72c827 100644 --- a/kernel/sysctl_check.c +++ b/kernel/sysctl_check.c | |||
@@ -5,1239 +5,6 @@ | |||
5 | #include <linux/string.h> | 5 | #include <linux/string.h> |
6 | #include <net/ip_vs.h> | 6 | #include <net/ip_vs.h> |
7 | 7 | ||
8 | struct trans_ctl_table { | ||
9 | int ctl_name; | ||
10 | const char *procname; | ||
11 | const struct trans_ctl_table *child; | ||
12 | }; | ||
13 | |||
14 | static const struct trans_ctl_table trans_random_table[] = { | ||
15 | { RANDOM_POOLSIZE, "poolsize" }, | ||
16 | { RANDOM_ENTROPY_COUNT, "entropy_avail" }, | ||
17 | { RANDOM_READ_THRESH, "read_wakeup_threshold" }, | ||
18 | { RANDOM_WRITE_THRESH, "write_wakeup_threshold" }, | ||
19 | { RANDOM_BOOT_ID, "boot_id" }, | ||
20 | { RANDOM_UUID, "uuid" }, | ||
21 | {} | ||
22 | }; | ||
23 | |||
24 | static const struct trans_ctl_table trans_pty_table[] = { | ||
25 | { PTY_MAX, "max" }, | ||
26 | { PTY_NR, "nr" }, | ||
27 | {} | ||
28 | }; | ||
29 | |||
30 | static const struct trans_ctl_table trans_kern_table[] = { | ||
31 | { KERN_OSTYPE, "ostype" }, | ||
32 | { KERN_OSRELEASE, "osrelease" }, | ||
33 | /* KERN_OSREV not used */ | ||
34 | { KERN_VERSION, "version" }, | ||
35 | /* KERN_SECUREMASK not used */ | ||
36 | /* KERN_PROF not used */ | ||
37 | { KERN_NODENAME, "hostname" }, | ||
38 | { KERN_DOMAINNAME, "domainname" }, | ||
39 | |||
40 | { KERN_PANIC, "panic" }, | ||
41 | { KERN_REALROOTDEV, "real-root-dev" }, | ||
42 | |||
43 | { KERN_SPARC_REBOOT, "reboot-cmd" }, | ||
44 | { KERN_CTLALTDEL, "ctrl-alt-del" }, | ||
45 | { KERN_PRINTK, "printk" }, | ||
46 | |||
47 | /* KERN_NAMETRANS not used */ | ||
48 | /* KERN_PPC_HTABRECLAIM not used */ | ||
49 | /* KERN_PPC_ZEROPAGED not used */ | ||
50 | { KERN_PPC_POWERSAVE_NAP, "powersave-nap" }, | ||
51 | |||
52 | { KERN_MODPROBE, "modprobe" }, | ||
53 | { KERN_SG_BIG_BUFF, "sg-big-buff" }, | ||
54 | { KERN_ACCT, "acct" }, | ||
55 | { KERN_PPC_L2CR, "l2cr" }, | ||
56 | |||
57 | /* KERN_RTSIGNR not used */ | ||
58 | /* KERN_RTSIGMAX not used */ | ||
59 | |||
60 | { KERN_SHMMAX, "shmmax" }, | ||
61 | { KERN_MSGMAX, "msgmax" }, | ||
62 | { KERN_MSGMNB, "msgmnb" }, | ||
63 | /* KERN_MSGPOOL not used*/ | ||
64 | { KERN_SYSRQ, "sysrq" }, | ||
65 | { KERN_MAX_THREADS, "threads-max" }, | ||
66 | { KERN_RANDOM, "random", trans_random_table }, | ||
67 | { KERN_SHMALL, "shmall" }, | ||
68 | { KERN_MSGMNI, "msgmni" }, | ||
69 | { KERN_SEM, "sem" }, | ||
70 | { KERN_SPARC_STOP_A, "stop-a" }, | ||
71 | { KERN_SHMMNI, "shmmni" }, | ||
72 | |||
73 | { KERN_OVERFLOWUID, "overflowuid" }, | ||
74 | { KERN_OVERFLOWGID, "overflowgid" }, | ||
75 | |||
76 | { KERN_HOTPLUG, "hotplug", }, | ||
77 | { KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" }, | ||
78 | |||
79 | { KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" }, | ||
80 | { KERN_CORE_USES_PID, "core_uses_pid" }, | ||
81 | { KERN_TAINTED, "tainted" }, | ||
82 | { KERN_CADPID, "cad_pid" }, | ||
83 | { KERN_PIDMAX, "pid_max" }, | ||
84 | { KERN_CORE_PATTERN, "core_pattern" }, | ||
85 | { KERN_PANIC_ON_OOPS, "panic_on_oops" }, | ||
86 | { KERN_HPPA_PWRSW, "soft-power" }, | ||
87 | { KERN_HPPA_UNALIGNED, "unaligned-trap" }, | ||
88 | |||
89 | { KERN_PRINTK_RATELIMIT, "printk_ratelimit" }, | ||
90 | { KERN_PRINTK_RATELIMIT_BURST, "printk_ratelimit_burst" }, | ||
91 | |||
92 | { KERN_PTY, "pty", trans_pty_table }, | ||
93 | { KERN_NGROUPS_MAX, "ngroups_max" }, | ||
94 | { KERN_SPARC_SCONS_PWROFF, "scons-poweroff" }, | ||
95 | { KERN_HZ_TIMER, "hz_timer" }, | ||
96 | { KERN_UNKNOWN_NMI_PANIC, "unknown_nmi_panic" }, | ||
97 | { KERN_BOOTLOADER_TYPE, "bootloader_type" }, | ||
98 | { KERN_RANDOMIZE, "randomize_va_space" }, | ||
99 | |||
100 | { KERN_SPIN_RETRY, "spin_retry" }, | ||
101 | { KERN_ACPI_VIDEO_FLAGS, "acpi_video_flags" }, | ||
102 | { KERN_IA64_UNALIGNED, "ignore-unaligned-usertrap" }, | ||
103 | { KERN_COMPAT_LOG, "compat-log" }, | ||
104 | { KERN_MAX_LOCK_DEPTH, "max_lock_depth" }, | ||
105 | { KERN_NMI_WATCHDOG, "nmi_watchdog" }, | ||
106 | { KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" }, | ||
107 | {} | ||
108 | }; | ||
109 | |||
110 | static const struct trans_ctl_table trans_vm_table[] = { | ||
111 | { VM_OVERCOMMIT_MEMORY, "overcommit_memory" }, | ||
112 | { VM_PAGE_CLUSTER, "page-cluster" }, | ||
113 | { VM_DIRTY_BACKGROUND, "dirty_background_ratio" }, | ||
114 | { VM_DIRTY_RATIO, "dirty_ratio" }, | ||
115 | { VM_DIRTY_WB_CS, "dirty_writeback_centisecs" }, | ||
116 | { VM_DIRTY_EXPIRE_CS, "dirty_expire_centisecs" }, | ||
117 | { VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads" }, | ||
118 | { VM_OVERCOMMIT_RATIO, "overcommit_ratio" }, | ||
119 | /* VM_PAGEBUF unused */ | ||
120 | { VM_HUGETLB_PAGES, "nr_hugepages" }, | ||
121 | { VM_SWAPPINESS, "swappiness" }, | ||
122 | { VM_LOWMEM_RESERVE_RATIO, "lowmem_reserve_ratio" }, | ||
123 | { VM_MIN_FREE_KBYTES, "min_free_kbytes" }, | ||
124 | { VM_MAX_MAP_COUNT, "max_map_count" }, | ||
125 | { VM_LAPTOP_MODE, "laptop_mode" }, | ||
126 | { VM_BLOCK_DUMP, "block_dump" }, | ||
127 | { VM_HUGETLB_GROUP, "hugetlb_shm_group" }, | ||
128 | { VM_VFS_CACHE_PRESSURE, "vfs_cache_pressure" }, | ||
129 | { VM_LEGACY_VA_LAYOUT, "legacy_va_layout" }, | ||
130 | /* VM_SWAP_TOKEN_TIMEOUT unused */ | ||
131 | { VM_DROP_PAGECACHE, "drop_caches" }, | ||
132 | { VM_PERCPU_PAGELIST_FRACTION, "percpu_pagelist_fraction" }, | ||
133 | { VM_ZONE_RECLAIM_MODE, "zone_reclaim_mode" }, | ||
134 | { VM_MIN_UNMAPPED, "min_unmapped_ratio" }, | ||
135 | { VM_PANIC_ON_OOM, "panic_on_oom" }, | ||
136 | { VM_VDSO_ENABLED, "vdso_enabled" }, | ||
137 | { VM_MIN_SLAB, "min_slab_ratio" }, | ||
138 | |||
139 | {} | ||
140 | }; | ||
141 | |||
142 | static const struct trans_ctl_table trans_net_core_table[] = { | ||
143 | { NET_CORE_WMEM_MAX, "wmem_max" }, | ||
144 | { NET_CORE_RMEM_MAX, "rmem_max" }, | ||
145 | { NET_CORE_WMEM_DEFAULT, "wmem_default" }, | ||
146 | { NET_CORE_RMEM_DEFAULT, "rmem_default" }, | ||
147 | /* NET_CORE_DESTROY_DELAY unused */ | ||
148 | { NET_CORE_MAX_BACKLOG, "netdev_max_backlog" }, | ||
149 | /* NET_CORE_FASTROUTE unused */ | ||
150 | { NET_CORE_MSG_COST, "message_cost" }, | ||
151 | { NET_CORE_MSG_BURST, "message_burst" }, | ||
152 | { NET_CORE_OPTMEM_MAX, "optmem_max" }, | ||
153 | /* NET_CORE_HOT_LIST_LENGTH unused */ | ||
154 | /* NET_CORE_DIVERT_VERSION unused */ | ||
155 | /* NET_CORE_NO_CONG_THRESH unused */ | ||
156 | /* NET_CORE_NO_CONG unused */ | ||
157 | /* NET_CORE_LO_CONG unused */ | ||
158 | /* NET_CORE_MOD_CONG unused */ | ||
159 | { NET_CORE_DEV_WEIGHT, "dev_weight" }, | ||
160 | { NET_CORE_SOMAXCONN, "somaxconn" }, | ||
161 | { NET_CORE_BUDGET, "netdev_budget" }, | ||
162 | { NET_CORE_AEVENT_ETIME, "xfrm_aevent_etime" }, | ||
163 | { NET_CORE_AEVENT_RSEQTH, "xfrm_aevent_rseqth" }, | ||
164 | { NET_CORE_WARNINGS, "warnings" }, | ||
165 | {}, | ||
166 | }; | ||
167 | |||
168 | static const struct trans_ctl_table trans_net_unix_table[] = { | ||
169 | /* NET_UNIX_DESTROY_DELAY unused */ | ||
170 | /* NET_UNIX_DELETE_DELAY unused */ | ||
171 | { NET_UNIX_MAX_DGRAM_QLEN, "max_dgram_qlen" }, | ||
172 | {} | ||
173 | }; | ||
174 | |||
175 | static const struct trans_ctl_table trans_net_ipv4_route_table[] = { | ||
176 | { NET_IPV4_ROUTE_FLUSH, "flush" }, | ||
177 | { NET_IPV4_ROUTE_MIN_DELAY, "min_delay" }, | ||
178 | { NET_IPV4_ROUTE_MAX_DELAY, "max_delay" }, | ||
179 | { NET_IPV4_ROUTE_GC_THRESH, "gc_thresh" }, | ||
180 | { NET_IPV4_ROUTE_MAX_SIZE, "max_size" }, | ||
181 | { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
182 | { NET_IPV4_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
183 | { NET_IPV4_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
184 | { NET_IPV4_ROUTE_REDIRECT_LOAD, "redirect_load" }, | ||
185 | { NET_IPV4_ROUTE_REDIRECT_NUMBER, "redirect_number" }, | ||
186 | { NET_IPV4_ROUTE_REDIRECT_SILENCE, "redirect_silence" }, | ||
187 | { NET_IPV4_ROUTE_ERROR_COST, "error_cost" }, | ||
188 | { NET_IPV4_ROUTE_ERROR_BURST, "error_burst" }, | ||
189 | { NET_IPV4_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
190 | { NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
191 | { NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" }, | ||
192 | { NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
193 | { NET_IPV4_ROUTE_SECRET_INTERVAL, "secret_interval" }, | ||
194 | { NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
195 | {} | ||
196 | }; | ||
197 | |||
198 | static const struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = { | ||
199 | { NET_IPV4_CONF_FORWARDING, "forwarding" }, | ||
200 | { NET_IPV4_CONF_MC_FORWARDING, "mc_forwarding" }, | ||
201 | |||
202 | { NET_IPV4_CONF_PROXY_ARP, "proxy_arp" }, | ||
203 | { NET_IPV4_CONF_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
204 | { NET_IPV4_CONF_SECURE_REDIRECTS, "secure_redirects" }, | ||
205 | { NET_IPV4_CONF_SEND_REDIRECTS, "send_redirects" }, | ||
206 | { NET_IPV4_CONF_SHARED_MEDIA, "shared_media" }, | ||
207 | { NET_IPV4_CONF_RP_FILTER, "rp_filter" }, | ||
208 | { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
209 | { NET_IPV4_CONF_BOOTP_RELAY, "bootp_relay" }, | ||
210 | { NET_IPV4_CONF_LOG_MARTIANS, "log_martians" }, | ||
211 | { NET_IPV4_CONF_TAG, "tag" }, | ||
212 | { NET_IPV4_CONF_ARPFILTER, "arp_filter" }, | ||
213 | { NET_IPV4_CONF_MEDIUM_ID, "medium_id" }, | ||
214 | { NET_IPV4_CONF_NOXFRM, "disable_xfrm" }, | ||
215 | { NET_IPV4_CONF_NOPOLICY, "disable_policy" }, | ||
216 | { NET_IPV4_CONF_FORCE_IGMP_VERSION, "force_igmp_version" }, | ||
217 | |||
218 | { NET_IPV4_CONF_ARP_ANNOUNCE, "arp_announce" }, | ||
219 | { NET_IPV4_CONF_ARP_IGNORE, "arp_ignore" }, | ||
220 | { NET_IPV4_CONF_PROMOTE_SECONDARIES, "promote_secondaries" }, | ||
221 | { NET_IPV4_CONF_ARP_ACCEPT, "arp_accept" }, | ||
222 | { NET_IPV4_CONF_ARP_NOTIFY, "arp_notify" }, | ||
223 | {} | ||
224 | }; | ||
225 | |||
226 | static const struct trans_ctl_table trans_net_ipv4_conf_table[] = { | ||
227 | { NET_PROTO_CONF_ALL, "all", trans_net_ipv4_conf_vars_table }, | ||
228 | { NET_PROTO_CONF_DEFAULT, "default", trans_net_ipv4_conf_vars_table }, | ||
229 | { 0, NULL, trans_net_ipv4_conf_vars_table }, | ||
230 | {} | ||
231 | }; | ||
232 | |||
233 | static const struct trans_ctl_table trans_net_neigh_vars_table[] = { | ||
234 | { NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" }, | ||
235 | { NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" }, | ||
236 | { NET_NEIGH_APP_SOLICIT, "app_solicit" }, | ||
237 | { NET_NEIGH_RETRANS_TIME, "retrans_time" }, | ||
238 | { NET_NEIGH_REACHABLE_TIME, "base_reachable_time" }, | ||
239 | { NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" }, | ||
240 | { NET_NEIGH_GC_STALE_TIME, "gc_stale_time" }, | ||
241 | { NET_NEIGH_UNRES_QLEN, "unres_qlen" }, | ||
242 | { NET_NEIGH_PROXY_QLEN, "proxy_qlen" }, | ||
243 | { NET_NEIGH_ANYCAST_DELAY, "anycast_delay" }, | ||
244 | { NET_NEIGH_PROXY_DELAY, "proxy_delay" }, | ||
245 | { NET_NEIGH_LOCKTIME, "locktime" }, | ||
246 | { NET_NEIGH_GC_INTERVAL, "gc_interval" }, | ||
247 | { NET_NEIGH_GC_THRESH1, "gc_thresh1" }, | ||
248 | { NET_NEIGH_GC_THRESH2, "gc_thresh2" }, | ||
249 | { NET_NEIGH_GC_THRESH3, "gc_thresh3" }, | ||
250 | { NET_NEIGH_RETRANS_TIME_MS, "retrans_time_ms" }, | ||
251 | { NET_NEIGH_REACHABLE_TIME_MS, "base_reachable_time_ms" }, | ||
252 | {} | ||
253 | }; | ||
254 | |||
255 | static const struct trans_ctl_table trans_net_neigh_table[] = { | ||
256 | { NET_PROTO_CONF_DEFAULT, "default", trans_net_neigh_vars_table }, | ||
257 | { 0, NULL, trans_net_neigh_vars_table }, | ||
258 | {} | ||
259 | }; | ||
260 | |||
261 | static const struct trans_ctl_table trans_net_ipv4_netfilter_table[] = { | ||
262 | { NET_IPV4_NF_CONNTRACK_MAX, "ip_conntrack_max" }, | ||
263 | |||
264 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT, "ip_conntrack_tcp_timeout_syn_sent" }, | ||
265 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV, "ip_conntrack_tcp_timeout_syn_recv" }, | ||
266 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED, "ip_conntrack_tcp_timeout_established" }, | ||
267 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT, "ip_conntrack_tcp_timeout_fin_wait" }, | ||
268 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT, "ip_conntrack_tcp_timeout_close_wait" }, | ||
269 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK, "ip_conntrack_tcp_timeout_last_ack" }, | ||
270 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT, "ip_conntrack_tcp_timeout_time_wait" }, | ||
271 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE, "ip_conntrack_tcp_timeout_close" }, | ||
272 | |||
273 | { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT, "ip_conntrack_udp_timeout" }, | ||
274 | { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM, "ip_conntrack_udp_timeout_stream" }, | ||
275 | { NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT, "ip_conntrack_icmp_timeout" }, | ||
276 | { NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT, "ip_conntrack_generic_timeout" }, | ||
277 | |||
278 | { NET_IPV4_NF_CONNTRACK_BUCKETS, "ip_conntrack_buckets" }, | ||
279 | { NET_IPV4_NF_CONNTRACK_LOG_INVALID, "ip_conntrack_log_invalid" }, | ||
280 | { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS, "ip_conntrack_tcp_timeout_max_retrans" }, | ||
281 | { NET_IPV4_NF_CONNTRACK_TCP_LOOSE, "ip_conntrack_tcp_loose" }, | ||
282 | { NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL, "ip_conntrack_tcp_be_liberal" }, | ||
283 | { NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS, "ip_conntrack_tcp_max_retrans" }, | ||
284 | |||
285 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED, "ip_conntrack_sctp_timeout_closed" }, | ||
286 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT, "ip_conntrack_sctp_timeout_cookie_wait" }, | ||
287 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED, "ip_conntrack_sctp_timeout_cookie_echoed" }, | ||
288 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED, "ip_conntrack_sctp_timeout_established" }, | ||
289 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT, "ip_conntrack_sctp_timeout_shutdown_sent" }, | ||
290 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD, "ip_conntrack_sctp_timeout_shutdown_recd" }, | ||
291 | { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "ip_conntrack_sctp_timeout_shutdown_ack_sent" }, | ||
292 | |||
293 | { NET_IPV4_NF_CONNTRACK_COUNT, "ip_conntrack_count" }, | ||
294 | { NET_IPV4_NF_CONNTRACK_CHECKSUM, "ip_conntrack_checksum" }, | ||
295 | {} | ||
296 | }; | ||
297 | |||
298 | static const struct trans_ctl_table trans_net_ipv4_table[] = { | ||
299 | { NET_IPV4_FORWARD, "ip_forward" }, | ||
300 | { NET_IPV4_DYNADDR, "ip_dynaddr" }, | ||
301 | |||
302 | { NET_IPV4_CONF, "conf", trans_net_ipv4_conf_table }, | ||
303 | { NET_IPV4_NEIGH, "neigh", trans_net_neigh_table }, | ||
304 | { NET_IPV4_ROUTE, "route", trans_net_ipv4_route_table }, | ||
305 | /* NET_IPV4_FIB_HASH unused */ | ||
306 | { NET_IPV4_NETFILTER, "netfilter", trans_net_ipv4_netfilter_table }, | ||
307 | |||
308 | { NET_IPV4_TCP_TIMESTAMPS, "tcp_timestamps" }, | ||
309 | { NET_IPV4_TCP_WINDOW_SCALING, "tcp_window_scaling" }, | ||
310 | { NET_IPV4_TCP_SACK, "tcp_sack" }, | ||
311 | { NET_IPV4_TCP_RETRANS_COLLAPSE, "tcp_retrans_collapse" }, | ||
312 | { NET_IPV4_DEFAULT_TTL, "ip_default_ttl" }, | ||
313 | /* NET_IPV4_AUTOCONFIG unused */ | ||
314 | { NET_IPV4_NO_PMTU_DISC, "ip_no_pmtu_disc" }, | ||
315 | { NET_IPV4_TCP_SYN_RETRIES, "tcp_syn_retries" }, | ||
316 | { NET_IPV4_IPFRAG_HIGH_THRESH, "ipfrag_high_thresh" }, | ||
317 | { NET_IPV4_IPFRAG_LOW_THRESH, "ipfrag_low_thresh" }, | ||
318 | { NET_IPV4_IPFRAG_TIME, "ipfrag_time" }, | ||
319 | /* NET_IPV4_TCP_MAX_KA_PROBES unused */ | ||
320 | { NET_IPV4_TCP_KEEPALIVE_TIME, "tcp_keepalive_time" }, | ||
321 | { NET_IPV4_TCP_KEEPALIVE_PROBES, "tcp_keepalive_probes" }, | ||
322 | { NET_IPV4_TCP_RETRIES1, "tcp_retries1" }, | ||
323 | { NET_IPV4_TCP_RETRIES2, "tcp_retries2" }, | ||
324 | { NET_IPV4_TCP_FIN_TIMEOUT, "tcp_fin_timeout" }, | ||
325 | /* NET_IPV4_IP_MASQ_DEBUG unused */ | ||
326 | { NET_TCP_SYNCOOKIES, "tcp_syncookies" }, | ||
327 | { NET_TCP_STDURG, "tcp_stdurg" }, | ||
328 | { NET_TCP_RFC1337, "tcp_rfc1337" }, | ||
329 | /* NET_TCP_SYN_TAILDROP unused */ | ||
330 | { NET_TCP_MAX_SYN_BACKLOG, "tcp_max_syn_backlog" }, | ||
331 | { NET_IPV4_LOCAL_PORT_RANGE, "ip_local_port_range" }, | ||
332 | { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "icmp_echo_ignore_all" }, | ||
333 | { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" }, | ||
334 | /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */ | ||
335 | /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */ | ||
336 | /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */ | ||
337 | /* NET_IPV4_ICMP_PARAMPROB_RATE unused */ | ||
338 | /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */ | ||
339 | { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "icmp_ignore_bogus_error_responses" }, | ||
340 | { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "igmp_max_memberships" }, | ||
341 | { NET_TCP_TW_RECYCLE, "tcp_tw_recycle" }, | ||
342 | /* NET_IPV4_ALWAYS_DEFRAG unused */ | ||
343 | { NET_IPV4_TCP_KEEPALIVE_INTVL, "tcp_keepalive_intvl" }, | ||
344 | { NET_IPV4_INET_PEER_THRESHOLD, "inet_peer_threshold" }, | ||
345 | { NET_IPV4_INET_PEER_MINTTL, "inet_peer_minttl" }, | ||
346 | { NET_IPV4_INET_PEER_MAXTTL, "inet_peer_maxttl" }, | ||
347 | { NET_IPV4_INET_PEER_GC_MINTIME, "inet_peer_gc_mintime" }, | ||
348 | { NET_IPV4_INET_PEER_GC_MAXTIME, "inet_peer_gc_maxtime" }, | ||
349 | { NET_TCP_ORPHAN_RETRIES, "tcp_orphan_retries" }, | ||
350 | { NET_TCP_ABORT_ON_OVERFLOW, "tcp_abort_on_overflow" }, | ||
351 | { NET_TCP_SYNACK_RETRIES, "tcp_synack_retries" }, | ||
352 | { NET_TCP_MAX_ORPHANS, "tcp_max_orphans" }, | ||
353 | { NET_TCP_MAX_TW_BUCKETS, "tcp_max_tw_buckets" }, | ||
354 | { NET_TCP_FACK, "tcp_fack" }, | ||
355 | { NET_TCP_REORDERING, "tcp_reordering" }, | ||
356 | { NET_TCP_ECN, "tcp_ecn" }, | ||
357 | { NET_TCP_DSACK, "tcp_dsack" }, | ||
358 | { NET_TCP_MEM, "tcp_mem" }, | ||
359 | { NET_TCP_WMEM, "tcp_wmem" }, | ||
360 | { NET_TCP_RMEM, "tcp_rmem" }, | ||
361 | { NET_TCP_APP_WIN, "tcp_app_win" }, | ||
362 | { NET_TCP_ADV_WIN_SCALE, "tcp_adv_win_scale" }, | ||
363 | { NET_IPV4_NONLOCAL_BIND, "ip_nonlocal_bind" }, | ||
364 | { NET_IPV4_ICMP_RATELIMIT, "icmp_ratelimit" }, | ||
365 | { NET_IPV4_ICMP_RATEMASK, "icmp_ratemask" }, | ||
366 | { NET_TCP_TW_REUSE, "tcp_tw_reuse" }, | ||
367 | { NET_TCP_FRTO, "tcp_frto" }, | ||
368 | { NET_TCP_LOW_LATENCY, "tcp_low_latency" }, | ||
369 | { NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval" }, | ||
370 | { NET_IPV4_IGMP_MAX_MSF, "igmp_max_msf" }, | ||
371 | { NET_TCP_NO_METRICS_SAVE, "tcp_no_metrics_save" }, | ||
372 | /* NET_TCP_DEFAULT_WIN_SCALE unused */ | ||
373 | { NET_TCP_MODERATE_RCVBUF, "tcp_moderate_rcvbuf" }, | ||
374 | { NET_TCP_TSO_WIN_DIVISOR, "tcp_tso_win_divisor" }, | ||
375 | /* NET_TCP_BIC_BETA unused */ | ||
376 | { NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, "icmp_errors_use_inbound_ifaddr" }, | ||
377 | { NET_TCP_CONG_CONTROL, "tcp_congestion_control" }, | ||
378 | { NET_TCP_ABC, "tcp_abc" }, | ||
379 | { NET_IPV4_IPFRAG_MAX_DIST, "ipfrag_max_dist" }, | ||
380 | { NET_TCP_MTU_PROBING, "tcp_mtu_probing" }, | ||
381 | { NET_TCP_BASE_MSS, "tcp_base_mss" }, | ||
382 | { NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, "tcp_workaround_signed_windows" }, | ||
383 | { NET_TCP_DMA_COPYBREAK, "tcp_dma_copybreak" }, | ||
384 | { NET_TCP_SLOW_START_AFTER_IDLE, "tcp_slow_start_after_idle" }, | ||
385 | { NET_CIPSOV4_CACHE_ENABLE, "cipso_cache_enable" }, | ||
386 | { NET_CIPSOV4_CACHE_BUCKET_SIZE, "cipso_cache_bucket_size" }, | ||
387 | { NET_CIPSOV4_RBM_OPTFMT, "cipso_rbm_optfmt" }, | ||
388 | { NET_CIPSOV4_RBM_STRICTVALID, "cipso_rbm_strictvalid" }, | ||
389 | { NET_TCP_AVAIL_CONG_CONTROL, "tcp_available_congestion_control" }, | ||
390 | { NET_TCP_ALLOWED_CONG_CONTROL, "tcp_allowed_congestion_control" }, | ||
391 | { NET_TCP_MAX_SSTHRESH, "tcp_max_ssthresh" }, | ||
392 | { NET_TCP_FRTO_RESPONSE, "tcp_frto_response" }, | ||
393 | { 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" }, | ||
394 | {} | ||
395 | }; | ||
396 | |||
397 | static const struct trans_ctl_table trans_net_ipx_table[] = { | ||
398 | { NET_IPX_PPROP_BROADCASTING, "ipx_pprop_broadcasting" }, | ||
399 | /* NET_IPX_FORWARDING unused */ | ||
400 | {} | ||
401 | }; | ||
402 | |||
403 | static const struct trans_ctl_table trans_net_atalk_table[] = { | ||
404 | { NET_ATALK_AARP_EXPIRY_TIME, "aarp-expiry-time" }, | ||
405 | { NET_ATALK_AARP_TICK_TIME, "aarp-tick-time" }, | ||
406 | { NET_ATALK_AARP_RETRANSMIT_LIMIT, "aarp-retransmit-limit" }, | ||
407 | { NET_ATALK_AARP_RESOLVE_TIME, "aarp-resolve-time" }, | ||
408 | {}, | ||
409 | }; | ||
410 | |||
411 | static const struct trans_ctl_table trans_net_netrom_table[] = { | ||
412 | { NET_NETROM_DEFAULT_PATH_QUALITY, "default_path_quality" }, | ||
413 | { NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, "obsolescence_count_initialiser" }, | ||
414 | { NET_NETROM_NETWORK_TTL_INITIALISER, "network_ttl_initialiser" }, | ||
415 | { NET_NETROM_TRANSPORT_TIMEOUT, "transport_timeout" }, | ||
416 | { NET_NETROM_TRANSPORT_MAXIMUM_TRIES, "transport_maximum_tries" }, | ||
417 | { NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, "transport_acknowledge_delay" }, | ||
418 | { NET_NETROM_TRANSPORT_BUSY_DELAY, "transport_busy_delay" }, | ||
419 | { NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, "transport_requested_window_size" }, | ||
420 | { NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, "transport_no_activity_timeout" }, | ||
421 | { NET_NETROM_ROUTING_CONTROL, "routing_control" }, | ||
422 | { NET_NETROM_LINK_FAILS_COUNT, "link_fails_count" }, | ||
423 | { NET_NETROM_RESET, "reset" }, | ||
424 | {} | ||
425 | }; | ||
426 | |||
427 | static const struct trans_ctl_table trans_net_ax25_param_table[] = { | ||
428 | { NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" }, | ||
429 | { NET_AX25_DEFAULT_MODE, "ax25_default_mode" }, | ||
430 | { NET_AX25_BACKOFF_TYPE, "backoff_type" }, | ||
431 | { NET_AX25_CONNECT_MODE, "connect_mode" }, | ||
432 | { NET_AX25_STANDARD_WINDOW, "standard_window_size" }, | ||
433 | { NET_AX25_EXTENDED_WINDOW, "extended_window_size" }, | ||
434 | { NET_AX25_T1_TIMEOUT, "t1_timeout" }, | ||
435 | { NET_AX25_T2_TIMEOUT, "t2_timeout" }, | ||
436 | { NET_AX25_T3_TIMEOUT, "t3_timeout" }, | ||
437 | { NET_AX25_IDLE_TIMEOUT, "idle_timeout" }, | ||
438 | { NET_AX25_N2, "maximum_retry_count" }, | ||
439 | { NET_AX25_PACLEN, "maximum_packet_length" }, | ||
440 | { NET_AX25_PROTOCOL, "protocol" }, | ||
441 | { NET_AX25_DAMA_SLAVE_TIMEOUT, "dama_slave_timeout" }, | ||
442 | {} | ||
443 | }; | ||
444 | |||
445 | static const struct trans_ctl_table trans_net_ax25_table[] = { | ||
446 | { 0, NULL, trans_net_ax25_param_table }, | ||
447 | {} | ||
448 | }; | ||
449 | |||
450 | static const struct trans_ctl_table trans_net_bridge_table[] = { | ||
451 | { NET_BRIDGE_NF_CALL_ARPTABLES, "bridge-nf-call-arptables" }, | ||
452 | { NET_BRIDGE_NF_CALL_IPTABLES, "bridge-nf-call-iptables" }, | ||
453 | { NET_BRIDGE_NF_CALL_IP6TABLES, "bridge-nf-call-ip6tables" }, | ||
454 | { NET_BRIDGE_NF_FILTER_VLAN_TAGGED, "bridge-nf-filter-vlan-tagged" }, | ||
455 | { NET_BRIDGE_NF_FILTER_PPPOE_TAGGED, "bridge-nf-filter-pppoe-tagged" }, | ||
456 | {} | ||
457 | }; | ||
458 | |||
459 | static const struct trans_ctl_table trans_net_rose_table[] = { | ||
460 | { NET_ROSE_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
461 | { NET_ROSE_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
462 | { NET_ROSE_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
463 | { NET_ROSE_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
464 | { NET_ROSE_ACK_HOLD_BACK_TIMEOUT, "acknowledge_hold_back_timeout" }, | ||
465 | { NET_ROSE_ROUTING_CONTROL, "routing_control" }, | ||
466 | { NET_ROSE_LINK_FAIL_TIMEOUT, "link_fail_timeout" }, | ||
467 | { NET_ROSE_MAX_VCS, "maximum_virtual_circuits" }, | ||
468 | { NET_ROSE_WINDOW_SIZE, "window_size" }, | ||
469 | { NET_ROSE_NO_ACTIVITY_TIMEOUT, "no_activity_timeout" }, | ||
470 | {} | ||
471 | }; | ||
472 | |||
473 | static const struct trans_ctl_table trans_net_ipv6_conf_var_table[] = { | ||
474 | { NET_IPV6_FORWARDING, "forwarding" }, | ||
475 | { NET_IPV6_HOP_LIMIT, "hop_limit" }, | ||
476 | { NET_IPV6_MTU, "mtu" }, | ||
477 | { NET_IPV6_ACCEPT_RA, "accept_ra" }, | ||
478 | { NET_IPV6_ACCEPT_REDIRECTS, "accept_redirects" }, | ||
479 | { NET_IPV6_AUTOCONF, "autoconf" }, | ||
480 | { NET_IPV6_DAD_TRANSMITS, "dad_transmits" }, | ||
481 | { NET_IPV6_RTR_SOLICITS, "router_solicitations" }, | ||
482 | { NET_IPV6_RTR_SOLICIT_INTERVAL, "router_solicitation_interval" }, | ||
483 | { NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay" }, | ||
484 | { NET_IPV6_USE_TEMPADDR, "use_tempaddr" }, | ||
485 | { NET_IPV6_TEMP_VALID_LFT, "temp_valid_lft" }, | ||
486 | { NET_IPV6_TEMP_PREFERED_LFT, "temp_prefered_lft" }, | ||
487 | { NET_IPV6_REGEN_MAX_RETRY, "regen_max_retry" }, | ||
488 | { NET_IPV6_MAX_DESYNC_FACTOR, "max_desync_factor" }, | ||
489 | { NET_IPV6_MAX_ADDRESSES, "max_addresses" }, | ||
490 | { NET_IPV6_FORCE_MLD_VERSION, "force_mld_version" }, | ||
491 | { NET_IPV6_ACCEPT_RA_DEFRTR, "accept_ra_defrtr" }, | ||
492 | { NET_IPV6_ACCEPT_RA_PINFO, "accept_ra_pinfo" }, | ||
493 | { NET_IPV6_ACCEPT_RA_RTR_PREF, "accept_ra_rtr_pref" }, | ||
494 | { NET_IPV6_RTR_PROBE_INTERVAL, "router_probe_interval" }, | ||
495 | { NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, "accept_ra_rt_info_max_plen" }, | ||
496 | { NET_IPV6_PROXY_NDP, "proxy_ndp" }, | ||
497 | { NET_IPV6_ACCEPT_SOURCE_ROUTE, "accept_source_route" }, | ||
498 | {} | ||
499 | }; | ||
500 | |||
501 | static const struct trans_ctl_table trans_net_ipv6_conf_table[] = { | ||
502 | { NET_PROTO_CONF_ALL, "all", trans_net_ipv6_conf_var_table }, | ||
503 | { NET_PROTO_CONF_DEFAULT, "default", trans_net_ipv6_conf_var_table }, | ||
504 | { 0, NULL, trans_net_ipv6_conf_var_table }, | ||
505 | {} | ||
506 | }; | ||
507 | |||
508 | static const struct trans_ctl_table trans_net_ipv6_route_table[] = { | ||
509 | { NET_IPV6_ROUTE_FLUSH, "flush" }, | ||
510 | { NET_IPV6_ROUTE_GC_THRESH, "gc_thresh" }, | ||
511 | { NET_IPV6_ROUTE_MAX_SIZE, "max_size" }, | ||
512 | { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" }, | ||
513 | { NET_IPV6_ROUTE_GC_TIMEOUT, "gc_timeout" }, | ||
514 | { NET_IPV6_ROUTE_GC_INTERVAL, "gc_interval" }, | ||
515 | { NET_IPV6_ROUTE_GC_ELASTICITY, "gc_elasticity" }, | ||
516 | { NET_IPV6_ROUTE_MTU_EXPIRES, "mtu_expires" }, | ||
517 | { NET_IPV6_ROUTE_MIN_ADVMSS, "min_adv_mss" }, | ||
518 | { NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" }, | ||
519 | {} | ||
520 | }; | ||
521 | |||
522 | static const struct trans_ctl_table trans_net_ipv6_icmp_table[] = { | ||
523 | { NET_IPV6_ICMP_RATELIMIT, "ratelimit" }, | ||
524 | {} | ||
525 | }; | ||
526 | |||
527 | static const struct trans_ctl_table trans_net_ipv6_table[] = { | ||
528 | { NET_IPV6_CONF, "conf", trans_net_ipv6_conf_table }, | ||
529 | { NET_IPV6_NEIGH, "neigh", trans_net_neigh_table }, | ||
530 | { NET_IPV6_ROUTE, "route", trans_net_ipv6_route_table }, | ||
531 | { NET_IPV6_ICMP, "icmp", trans_net_ipv6_icmp_table }, | ||
532 | { NET_IPV6_BINDV6ONLY, "bindv6only" }, | ||
533 | { NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" }, | ||
534 | { NET_IPV6_IP6FRAG_LOW_THRESH, "ip6frag_low_thresh" }, | ||
535 | { NET_IPV6_IP6FRAG_TIME, "ip6frag_time" }, | ||
536 | { NET_IPV6_IP6FRAG_SECRET_INTERVAL, "ip6frag_secret_interval" }, | ||
537 | { NET_IPV6_MLD_MAX_MSF, "mld_max_msf" }, | ||
538 | { 2088 /* IPQ_QMAX */, "ip6_queue_maxlen" }, | ||
539 | {} | ||
540 | }; | ||
541 | |||
542 | static const struct trans_ctl_table trans_net_x25_table[] = { | ||
543 | { NET_X25_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" }, | ||
544 | { NET_X25_CALL_REQUEST_TIMEOUT, "call_request_timeout" }, | ||
545 | { NET_X25_RESET_REQUEST_TIMEOUT, "reset_request_timeout" }, | ||
546 | { NET_X25_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" }, | ||
547 | { NET_X25_ACK_HOLD_BACK_TIMEOUT, "acknowledgement_hold_back_timeout" }, | ||
548 | { NET_X25_FORWARD, "x25_forward" }, | ||
549 | {} | ||
550 | }; | ||
551 | |||
552 | static const struct trans_ctl_table trans_net_tr_table[] = { | ||
553 | { NET_TR_RIF_TIMEOUT, "rif_timeout" }, | ||
554 | {} | ||
555 | }; | ||
556 | |||
557 | |||
558 | static const struct trans_ctl_table trans_net_decnet_conf_vars[] = { | ||
559 | { NET_DECNET_CONF_DEV_FORWARDING, "forwarding" }, | ||
560 | { NET_DECNET_CONF_DEV_PRIORITY, "priority" }, | ||
561 | { NET_DECNET_CONF_DEV_T2, "t2" }, | ||
562 | { NET_DECNET_CONF_DEV_T3, "t3" }, | ||
563 | {} | ||
564 | }; | ||
565 | |||
566 | static const struct trans_ctl_table trans_net_decnet_conf[] = { | ||
567 | { 0, NULL, trans_net_decnet_conf_vars }, | ||
568 | {} | ||
569 | }; | ||
570 | |||
571 | static const struct trans_ctl_table trans_net_decnet_table[] = { | ||
572 | { NET_DECNET_CONF, "conf", trans_net_decnet_conf }, | ||
573 | { NET_DECNET_NODE_ADDRESS, "node_address" }, | ||
574 | { NET_DECNET_NODE_NAME, "node_name" }, | ||
575 | { NET_DECNET_DEFAULT_DEVICE, "default_device" }, | ||
576 | { NET_DECNET_TIME_WAIT, "time_wait" }, | ||
577 | { NET_DECNET_DN_COUNT, "dn_count" }, | ||
578 | { NET_DECNET_DI_COUNT, "di_count" }, | ||
579 | { NET_DECNET_DR_COUNT, "dr_count" }, | ||
580 | { NET_DECNET_DST_GC_INTERVAL, "dst_gc_interval" }, | ||
581 | { NET_DECNET_NO_FC_MAX_CWND, "no_fc_max_cwnd" }, | ||
582 | { NET_DECNET_MEM, "decnet_mem" }, | ||
583 | { NET_DECNET_RMEM, "decnet_rmem" }, | ||
584 | { NET_DECNET_WMEM, "decnet_wmem" }, | ||
585 | { NET_DECNET_DEBUG_LEVEL, "debug" }, | ||
586 | {} | ||
587 | }; | ||
588 | |||
589 | static const struct trans_ctl_table trans_net_sctp_table[] = { | ||
590 | { NET_SCTP_RTO_INITIAL, "rto_initial" }, | ||
591 | { NET_SCTP_RTO_MIN, "rto_min" }, | ||
592 | { NET_SCTP_RTO_MAX, "rto_max" }, | ||
593 | { NET_SCTP_RTO_ALPHA, "rto_alpha_exp_divisor" }, | ||
594 | { NET_SCTP_RTO_BETA, "rto_beta_exp_divisor" }, | ||
595 | { NET_SCTP_VALID_COOKIE_LIFE, "valid_cookie_life" }, | ||
596 | { NET_SCTP_ASSOCIATION_MAX_RETRANS, "association_max_retrans" }, | ||
597 | { NET_SCTP_PATH_MAX_RETRANS, "path_max_retrans" }, | ||
598 | { NET_SCTP_MAX_INIT_RETRANSMITS, "max_init_retransmits" }, | ||
599 | { NET_SCTP_HB_INTERVAL, "hb_interval" }, | ||
600 | { NET_SCTP_PRESERVE_ENABLE, "cookie_preserve_enable" }, | ||
601 | { NET_SCTP_MAX_BURST, "max_burst" }, | ||
602 | { NET_SCTP_ADDIP_ENABLE, "addip_enable" }, | ||
603 | { NET_SCTP_PRSCTP_ENABLE, "prsctp_enable" }, | ||
604 | { NET_SCTP_SNDBUF_POLICY, "sndbuf_policy" }, | ||
605 | { NET_SCTP_SACK_TIMEOUT, "sack_timeout" }, | ||
606 | { NET_SCTP_RCVBUF_POLICY, "rcvbuf_policy" }, | ||
607 | {} | ||
608 | }; | ||
609 | |||
610 | static const struct trans_ctl_table trans_net_llc_llc2_timeout_table[] = { | ||
611 | { NET_LLC2_ACK_TIMEOUT, "ack" }, | ||
612 | { NET_LLC2_P_TIMEOUT, "p" }, | ||
613 | { NET_LLC2_REJ_TIMEOUT, "rej" }, | ||
614 | { NET_LLC2_BUSY_TIMEOUT, "busy" }, | ||
615 | {} | ||
616 | }; | ||
617 | |||
618 | static const struct trans_ctl_table trans_net_llc_station_table[] = { | ||
619 | { NET_LLC_STATION_ACK_TIMEOUT, "ack_timeout" }, | ||
620 | {} | ||
621 | }; | ||
622 | |||
623 | static const struct trans_ctl_table trans_net_llc_llc2_table[] = { | ||
624 | { NET_LLC2, "timeout", trans_net_llc_llc2_timeout_table }, | ||
625 | {} | ||
626 | }; | ||
627 | |||
628 | static const struct trans_ctl_table trans_net_llc_table[] = { | ||
629 | { NET_LLC2, "llc2", trans_net_llc_llc2_table }, | ||
630 | { NET_LLC_STATION, "station", trans_net_llc_station_table }, | ||
631 | {} | ||
632 | }; | ||
633 | |||
634 | static const struct trans_ctl_table trans_net_netfilter_table[] = { | ||
635 | { NET_NF_CONNTRACK_MAX, "nf_conntrack_max" }, | ||
636 | { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT, "nf_conntrack_tcp_timeout_syn_sent" }, | ||
637 | { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV, "nf_conntrack_tcp_timeout_syn_recv" }, | ||
638 | { NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED, "nf_conntrack_tcp_timeout_established" }, | ||
639 | { NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT, "nf_conntrack_tcp_timeout_fin_wait" }, | ||
640 | { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT, "nf_conntrack_tcp_timeout_close_wait" }, | ||
641 | { NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK, "nf_conntrack_tcp_timeout_last_ack" }, | ||
642 | { NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT, "nf_conntrack_tcp_timeout_time_wait" }, | ||
643 | { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE, "nf_conntrack_tcp_timeout_close" }, | ||
644 | { NET_NF_CONNTRACK_UDP_TIMEOUT, "nf_conntrack_udp_timeout" }, | ||
645 | { NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM, "nf_conntrack_udp_timeout_stream" }, | ||
646 | { NET_NF_CONNTRACK_ICMP_TIMEOUT, "nf_conntrack_icmp_timeout" }, | ||
647 | { NET_NF_CONNTRACK_GENERIC_TIMEOUT, "nf_conntrack_generic_timeout" }, | ||
648 | { NET_NF_CONNTRACK_BUCKETS, "nf_conntrack_buckets" }, | ||
649 | { NET_NF_CONNTRACK_LOG_INVALID, "nf_conntrack_log_invalid" }, | ||
650 | { NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS, "nf_conntrack_tcp_timeout_max_retrans" }, | ||
651 | { NET_NF_CONNTRACK_TCP_LOOSE, "nf_conntrack_tcp_loose" }, | ||
652 | { NET_NF_CONNTRACK_TCP_BE_LIBERAL, "nf_conntrack_tcp_be_liberal" }, | ||
653 | { NET_NF_CONNTRACK_TCP_MAX_RETRANS, "nf_conntrack_tcp_max_retrans" }, | ||
654 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED, "nf_conntrack_sctp_timeout_closed" }, | ||
655 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT, "nf_conntrack_sctp_timeout_cookie_wait" }, | ||
656 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED, "nf_conntrack_sctp_timeout_cookie_echoed" }, | ||
657 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED, "nf_conntrack_sctp_timeout_established" }, | ||
658 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT, "nf_conntrack_sctp_timeout_shutdown_sent" }, | ||
659 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD, "nf_conntrack_sctp_timeout_shutdown_recd" }, | ||
660 | { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "nf_conntrack_sctp_timeout_shutdown_ack_sent" }, | ||
661 | { NET_NF_CONNTRACK_COUNT, "nf_conntrack_count" }, | ||
662 | { NET_NF_CONNTRACK_ICMPV6_TIMEOUT, "nf_conntrack_icmpv6_timeout" }, | ||
663 | { NET_NF_CONNTRACK_FRAG6_TIMEOUT, "nf_conntrack_frag6_timeout" }, | ||
664 | { NET_NF_CONNTRACK_FRAG6_LOW_THRESH, "nf_conntrack_frag6_low_thresh" }, | ||
665 | { NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, "nf_conntrack_frag6_high_thresh" }, | ||
666 | { NET_NF_CONNTRACK_CHECKSUM, "nf_conntrack_checksum" }, | ||
667 | |||
668 | {} | ||
669 | }; | ||
670 | |||
671 | static const struct trans_ctl_table trans_net_dccp_table[] = { | ||
672 | { NET_DCCP_DEFAULT, "default" }, | ||
673 | {} | ||
674 | }; | ||
675 | |||
676 | static const struct trans_ctl_table trans_net_irda_table[] = { | ||
677 | { NET_IRDA_DISCOVERY, "discovery" }, | ||
678 | { NET_IRDA_DEVNAME, "devname" }, | ||
679 | { NET_IRDA_DEBUG, "debug" }, | ||
680 | { NET_IRDA_FAST_POLL, "fast_poll_increase" }, | ||
681 | { NET_IRDA_DISCOVERY_SLOTS, "discovery_slots" }, | ||
682 | { NET_IRDA_DISCOVERY_TIMEOUT, "discovery_timeout" }, | ||
683 | { NET_IRDA_SLOT_TIMEOUT, "slot_timeout" }, | ||
684 | { NET_IRDA_MAX_BAUD_RATE, "max_baud_rate" }, | ||
685 | { NET_IRDA_MIN_TX_TURN_TIME, "min_tx_turn_time" }, | ||
686 | { NET_IRDA_MAX_TX_DATA_SIZE, "max_tx_data_size" }, | ||
687 | { NET_IRDA_MAX_TX_WINDOW, "max_tx_window" }, | ||
688 | { NET_IRDA_MAX_NOREPLY_TIME, "max_noreply_time" }, | ||
689 | { NET_IRDA_WARN_NOREPLY_TIME, "warn_noreply_time" }, | ||
690 | { NET_IRDA_LAP_KEEPALIVE_TIME, "lap_keepalive_time" }, | ||
691 | {} | ||
692 | }; | ||
693 | |||
694 | static const struct trans_ctl_table trans_net_table[] = { | ||
695 | { NET_CORE, "core", trans_net_core_table }, | ||
696 | /* NET_ETHER not used */ | ||
697 | /* NET_802 not used */ | ||
698 | { NET_UNIX, "unix", trans_net_unix_table }, | ||
699 | { NET_IPV4, "ipv4", trans_net_ipv4_table }, | ||
700 | { NET_IPX, "ipx", trans_net_ipx_table }, | ||
701 | { NET_ATALK, "appletalk", trans_net_atalk_table }, | ||
702 | { NET_NETROM, "netrom", trans_net_netrom_table }, | ||
703 | { NET_AX25, "ax25", trans_net_ax25_table }, | ||
704 | { NET_BRIDGE, "bridge", trans_net_bridge_table }, | ||
705 | { NET_ROSE, "rose", trans_net_rose_table }, | ||
706 | { NET_IPV6, "ipv6", trans_net_ipv6_table }, | ||
707 | { NET_X25, "x25", trans_net_x25_table }, | ||
708 | { NET_TR, "token-ring", trans_net_tr_table }, | ||
709 | { NET_DECNET, "decnet", trans_net_decnet_table }, | ||
710 | /* NET_ECONET not used */ | ||
711 | { NET_SCTP, "sctp", trans_net_sctp_table }, | ||
712 | { NET_LLC, "llc", trans_net_llc_table }, | ||
713 | { NET_NETFILTER, "netfilter", trans_net_netfilter_table }, | ||
714 | { NET_DCCP, "dccp", trans_net_dccp_table }, | ||
715 | { NET_IRDA, "irda", trans_net_irda_table }, | ||
716 | { 2089, "nf_conntrack_max" }, | ||
717 | {} | ||
718 | }; | ||
719 | |||
720 | static const struct trans_ctl_table trans_fs_quota_table[] = { | ||
721 | { FS_DQ_LOOKUPS, "lookups" }, | ||
722 | { FS_DQ_DROPS, "drops" }, | ||
723 | { FS_DQ_READS, "reads" }, | ||
724 | { FS_DQ_WRITES, "writes" }, | ||
725 | { FS_DQ_CACHE_HITS, "cache_hits" }, | ||
726 | { FS_DQ_ALLOCATED, "allocated_dquots" }, | ||
727 | { FS_DQ_FREE, "free_dquots" }, | ||
728 | { FS_DQ_SYNCS, "syncs" }, | ||
729 | { FS_DQ_WARNINGS, "warnings" }, | ||
730 | {} | ||
731 | }; | ||
732 | |||
733 | static const struct trans_ctl_table trans_fs_xfs_table[] = { | ||
734 | { XFS_SGID_INHERIT, "irix_sgid_inherit" }, | ||
735 | { XFS_SYMLINK_MODE, "irix_symlink_mode" }, | ||
736 | { XFS_PANIC_MASK, "panic_mask" }, | ||
737 | |||
738 | { XFS_ERRLEVEL, "error_level" }, | ||
739 | { XFS_SYNCD_TIMER, "xfssyncd_centisecs" }, | ||
740 | { XFS_INHERIT_SYNC, "inherit_sync" }, | ||
741 | { XFS_INHERIT_NODUMP, "inherit_nodump" }, | ||
742 | { XFS_INHERIT_NOATIME, "inherit_noatime" }, | ||
743 | { XFS_BUF_TIMER, "xfsbufd_centisecs" }, | ||
744 | { XFS_BUF_AGE, "age_buffer_centisecs" }, | ||
745 | { XFS_INHERIT_NOSYM, "inherit_nosymlinks" }, | ||
746 | { XFS_ROTORSTEP, "rotorstep" }, | ||
747 | { XFS_INHERIT_NODFRG, "inherit_nodefrag" }, | ||
748 | { XFS_FILESTREAM_TIMER, "filestream_centisecs" }, | ||
749 | { XFS_STATS_CLEAR, "stats_clear" }, | ||
750 | {} | ||
751 | }; | ||
752 | |||
753 | static const struct trans_ctl_table trans_fs_ocfs2_nm_table[] = { | ||
754 | { 1, "hb_ctl_path" }, | ||
755 | {} | ||
756 | }; | ||
757 | |||
758 | static const struct trans_ctl_table trans_fs_ocfs2_table[] = { | ||
759 | { 1, "nm", trans_fs_ocfs2_nm_table }, | ||
760 | {} | ||
761 | }; | ||
762 | |||
763 | static const struct trans_ctl_table trans_inotify_table[] = { | ||
764 | { INOTIFY_MAX_USER_INSTANCES, "max_user_instances" }, | ||
765 | { INOTIFY_MAX_USER_WATCHES, "max_user_watches" }, | ||
766 | { INOTIFY_MAX_QUEUED_EVENTS, "max_queued_events" }, | ||
767 | {} | ||
768 | }; | ||
769 | |||
770 | static const struct trans_ctl_table trans_fs_table[] = { | ||
771 | { FS_NRINODE, "inode-nr" }, | ||
772 | { FS_STATINODE, "inode-state" }, | ||
773 | /* FS_MAXINODE unused */ | ||
774 | /* FS_NRDQUOT unused */ | ||
775 | /* FS_MAXDQUOT unused */ | ||
776 | { FS_NRFILE, "file-nr" }, | ||
777 | { FS_MAXFILE, "file-max" }, | ||
778 | { FS_DENTRY, "dentry-state" }, | ||
779 | /* FS_NRSUPER unused */ | ||
780 | /* FS_MAXUPSER unused */ | ||
781 | { FS_OVERFLOWUID, "overflowuid" }, | ||
782 | { FS_OVERFLOWGID, "overflowgid" }, | ||
783 | { FS_LEASES, "leases-enable" }, | ||
784 | { FS_DIR_NOTIFY, "dir-notify-enable" }, | ||
785 | { FS_LEASE_TIME, "lease-break-time" }, | ||
786 | { FS_DQSTATS, "quota", trans_fs_quota_table }, | ||
787 | { FS_XFS, "xfs", trans_fs_xfs_table }, | ||
788 | { FS_AIO_NR, "aio-nr" }, | ||
789 | { FS_AIO_MAX_NR, "aio-max-nr" }, | ||
790 | { FS_INOTIFY, "inotify", trans_inotify_table }, | ||
791 | { FS_OCFS2, "ocfs2", trans_fs_ocfs2_table }, | ||
792 | { KERN_SETUID_DUMPABLE, "suid_dumpable" }, | ||
793 | {} | ||
794 | }; | ||
795 | |||
796 | static const struct trans_ctl_table trans_debug_table[] = { | ||
797 | {} | ||
798 | }; | ||
799 | |||
800 | static const struct trans_ctl_table trans_cdrom_table[] = { | ||
801 | { DEV_CDROM_INFO, "info" }, | ||
802 | { DEV_CDROM_AUTOCLOSE, "autoclose" }, | ||
803 | { DEV_CDROM_AUTOEJECT, "autoeject" }, | ||
804 | { DEV_CDROM_DEBUG, "debug" }, | ||
805 | { DEV_CDROM_LOCK, "lock" }, | ||
806 | { DEV_CDROM_CHECK_MEDIA, "check_media" }, | ||
807 | {} | ||
808 | }; | ||
809 | |||
810 | static const struct trans_ctl_table trans_ipmi_table[] = { | ||
811 | { DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" }, | ||
812 | {} | ||
813 | }; | ||
814 | |||
815 | static const struct trans_ctl_table trans_mac_hid_files[] = { | ||
816 | /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */ | ||
817 | /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */ | ||
818 | { DEV_MAC_HID_MOUSE_BUTTON_EMULATION, "mouse_button_emulation" }, | ||
819 | { DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, "mouse_button2_keycode" }, | ||
820 | { DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, "mouse_button3_keycode" }, | ||
821 | /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */ | ||
822 | {} | ||
823 | }; | ||
824 | |||
825 | static const struct trans_ctl_table trans_raid_table[] = { | ||
826 | { DEV_RAID_SPEED_LIMIT_MIN, "speed_limit_min" }, | ||
827 | { DEV_RAID_SPEED_LIMIT_MAX, "speed_limit_max" }, | ||
828 | {} | ||
829 | }; | ||
830 | |||
831 | static const struct trans_ctl_table trans_scsi_table[] = { | ||
832 | { DEV_SCSI_LOGGING_LEVEL, "logging_level" }, | ||
833 | {} | ||
834 | }; | ||
835 | |||
836 | static const struct trans_ctl_table trans_parport_default_table[] = { | ||
837 | { DEV_PARPORT_DEFAULT_TIMESLICE, "timeslice" }, | ||
838 | { DEV_PARPORT_DEFAULT_SPINTIME, "spintime" }, | ||
839 | {} | ||
840 | }; | ||
841 | |||
842 | static const struct trans_ctl_table trans_parport_device_table[] = { | ||
843 | { DEV_PARPORT_DEVICE_TIMESLICE, "timeslice" }, | ||
844 | {} | ||
845 | }; | ||
846 | |||
847 | static const struct trans_ctl_table trans_parport_devices_table[] = { | ||
848 | { DEV_PARPORT_DEVICES_ACTIVE, "active" }, | ||
849 | { 0, NULL, trans_parport_device_table }, | ||
850 | {} | ||
851 | }; | ||
852 | |||
853 | static const struct trans_ctl_table trans_parport_parport_table[] = { | ||
854 | { DEV_PARPORT_SPINTIME, "spintime" }, | ||
855 | { DEV_PARPORT_BASE_ADDR, "base-addr" }, | ||
856 | { DEV_PARPORT_IRQ, "irq" }, | ||
857 | { DEV_PARPORT_DMA, "dma" }, | ||
858 | { DEV_PARPORT_MODES, "modes" }, | ||
859 | { DEV_PARPORT_DEVICES, "devices", trans_parport_devices_table }, | ||
860 | { DEV_PARPORT_AUTOPROBE, "autoprobe" }, | ||
861 | { DEV_PARPORT_AUTOPROBE + 1, "autoprobe0" }, | ||
862 | { DEV_PARPORT_AUTOPROBE + 2, "autoprobe1" }, | ||
863 | { DEV_PARPORT_AUTOPROBE + 3, "autoprobe2" }, | ||
864 | { DEV_PARPORT_AUTOPROBE + 4, "autoprobe3" }, | ||
865 | {} | ||
866 | }; | ||
867 | static const struct trans_ctl_table trans_parport_table[] = { | ||
868 | { DEV_PARPORT_DEFAULT, "default", trans_parport_default_table }, | ||
869 | { 0, NULL, trans_parport_parport_table }, | ||
870 | {} | ||
871 | }; | ||
872 | |||
873 | static const struct trans_ctl_table trans_dev_table[] = { | ||
874 | { DEV_CDROM, "cdrom", trans_cdrom_table }, | ||
875 | /* DEV_HWMON unused */ | ||
876 | { DEV_PARPORT, "parport", trans_parport_table }, | ||
877 | { DEV_RAID, "raid", trans_raid_table }, | ||
878 | { DEV_MAC_HID, "mac_hid", trans_mac_hid_files }, | ||
879 | { DEV_SCSI, "scsi", trans_scsi_table }, | ||
880 | { DEV_IPMI, "ipmi", trans_ipmi_table }, | ||
881 | {} | ||
882 | }; | ||
883 | |||
884 | static const struct trans_ctl_table trans_bus_isa_table[] = { | ||
885 | { BUS_ISA_MEM_BASE, "membase" }, | ||
886 | { BUS_ISA_PORT_BASE, "portbase" }, | ||
887 | { BUS_ISA_PORT_SHIFT, "portshift" }, | ||
888 | {} | ||
889 | }; | ||
890 | |||
891 | static const struct trans_ctl_table trans_bus_table[] = { | ||
892 | { CTL_BUS_ISA, "isa", trans_bus_isa_table }, | ||
893 | {} | ||
894 | }; | ||
895 | |||
896 | static const struct trans_ctl_table trans_arlan_conf_table0[] = { | ||
897 | { 1, "spreadingCode" }, | ||
898 | { 2, "channelNumber" }, | ||
899 | { 3, "scramblingDisable" }, | ||
900 | { 4, "txAttenuation" }, | ||
901 | { 5, "systemId" }, | ||
902 | { 6, "maxDatagramSize" }, | ||
903 | { 7, "maxFrameSize" }, | ||
904 | { 8, "maxRetries" }, | ||
905 | { 9, "receiveMode" }, | ||
906 | { 10, "priority" }, | ||
907 | { 11, "rootOrRepeater" }, | ||
908 | { 12, "SID" }, | ||
909 | { 13, "registrationMode" }, | ||
910 | { 14, "registrationFill" }, | ||
911 | { 15, "localTalkAddress" }, | ||
912 | { 16, "codeFormat" }, | ||
913 | { 17, "numChannels" }, | ||
914 | { 18, "channel1" }, | ||
915 | { 19, "channel2" }, | ||
916 | { 20, "channel3" }, | ||
917 | { 21, "channel4" }, | ||
918 | { 22, "txClear" }, | ||
919 | { 23, "txRetries" }, | ||
920 | { 24, "txRouting" }, | ||
921 | { 25, "txScrambled" }, | ||
922 | { 26, "rxParameter" }, | ||
923 | { 27, "txTimeoutMs" }, | ||
924 | { 28, "waitCardTimeout" }, | ||
925 | { 29, "channelSet" }, | ||
926 | { 30, "name" }, | ||
927 | { 31, "waitTime" }, | ||
928 | { 32, "lParameter" }, | ||
929 | { 33, "_15" }, | ||
930 | { 34, "headerSize" }, | ||
931 | { 36, "tx_delay_ms" }, | ||
932 | { 37, "retries" }, | ||
933 | { 38, "ReTransmitPacketMaxSize" }, | ||
934 | { 39, "waitReTransmitPacketMaxSize" }, | ||
935 | { 40, "fastReTransCount" }, | ||
936 | { 41, "driverRetransmissions" }, | ||
937 | { 42, "txAckTimeoutMs" }, | ||
938 | { 43, "registrationInterrupts" }, | ||
939 | { 44, "hardwareType" }, | ||
940 | { 45, "radioType" }, | ||
941 | { 46, "writeEEPROM" }, | ||
942 | { 47, "writeRadioType" }, | ||
943 | { 48, "entry_exit_debug" }, | ||
944 | { 49, "debug" }, | ||
945 | { 50, "in_speed" }, | ||
946 | { 51, "out_speed" }, | ||
947 | { 52, "in_speed10" }, | ||
948 | { 53, "out_speed10" }, | ||
949 | { 54, "in_speed_max" }, | ||
950 | { 55, "out_speed_max" }, | ||
951 | { 56, "measure_rate" }, | ||
952 | { 57, "pre_Command_Wait" }, | ||
953 | { 58, "rx_tweak1" }, | ||
954 | { 59, "rx_tweak2" }, | ||
955 | { 60, "tx_queue_len" }, | ||
956 | |||
957 | { 150, "arlan0-txRing" }, | ||
958 | { 151, "arlan0-rxRing" }, | ||
959 | { 152, "arlan0-18" }, | ||
960 | { 153, "arlan0-ring" }, | ||
961 | { 154, "arlan0-shm-cpy" }, | ||
962 | { 155, "config0" }, | ||
963 | { 156, "reset0" }, | ||
964 | {} | ||
965 | }; | ||
966 | |||
967 | static const struct trans_ctl_table trans_arlan_conf_table1[] = { | ||
968 | { 1, "spreadingCode" }, | ||
969 | { 2, "channelNumber" }, | ||
970 | { 3, "scramblingDisable" }, | ||
971 | { 4, "txAttenuation" }, | ||
972 | { 5, "systemId" }, | ||
973 | { 6, "maxDatagramSize" }, | ||
974 | { 7, "maxFrameSize" }, | ||
975 | { 8, "maxRetries" }, | ||
976 | { 9, "receiveMode" }, | ||
977 | { 10, "priority" }, | ||
978 | { 11, "rootOrRepeater" }, | ||
979 | { 12, "SID" }, | ||
980 | { 13, "registrationMode" }, | ||
981 | { 14, "registrationFill" }, | ||
982 | { 15, "localTalkAddress" }, | ||
983 | { 16, "codeFormat" }, | ||
984 | { 17, "numChannels" }, | ||
985 | { 18, "channel1" }, | ||
986 | { 19, "channel2" }, | ||
987 | { 20, "channel3" }, | ||
988 | { 21, "channel4" }, | ||
989 | { 22, "txClear" }, | ||
990 | { 23, "txRetries" }, | ||
991 | { 24, "txRouting" }, | ||
992 | { 25, "txScrambled" }, | ||
993 | { 26, "rxParameter" }, | ||
994 | { 27, "txTimeoutMs" }, | ||
995 | { 28, "waitCardTimeout" }, | ||
996 | { 29, "channelSet" }, | ||
997 | { 30, "name" }, | ||
998 | { 31, "waitTime" }, | ||
999 | { 32, "lParameter" }, | ||
1000 | { 33, "_15" }, | ||
1001 | { 34, "headerSize" }, | ||
1002 | { 36, "tx_delay_ms" }, | ||
1003 | { 37, "retries" }, | ||
1004 | { 38, "ReTransmitPacketMaxSize" }, | ||
1005 | { 39, "waitReTransmitPacketMaxSize" }, | ||
1006 | { 40, "fastReTransCount" }, | ||
1007 | { 41, "driverRetransmissions" }, | ||
1008 | { 42, "txAckTimeoutMs" }, | ||
1009 | { 43, "registrationInterrupts" }, | ||
1010 | { 44, "hardwareType" }, | ||
1011 | { 45, "radioType" }, | ||
1012 | { 46, "writeEEPROM" }, | ||
1013 | { 47, "writeRadioType" }, | ||
1014 | { 48, "entry_exit_debug" }, | ||
1015 | { 49, "debug" }, | ||
1016 | { 50, "in_speed" }, | ||
1017 | { 51, "out_speed" }, | ||
1018 | { 52, "in_speed10" }, | ||
1019 | { 53, "out_speed10" }, | ||
1020 | { 54, "in_speed_max" }, | ||
1021 | { 55, "out_speed_max" }, | ||
1022 | { 56, "measure_rate" }, | ||
1023 | { 57, "pre_Command_Wait" }, | ||
1024 | { 58, "rx_tweak1" }, | ||
1025 | { 59, "rx_tweak2" }, | ||
1026 | { 60, "tx_queue_len" }, | ||
1027 | |||
1028 | { 150, "arlan1-txRing" }, | ||
1029 | { 151, "arlan1-rxRing" }, | ||
1030 | { 152, "arlan1-18" }, | ||
1031 | { 153, "arlan1-ring" }, | ||
1032 | { 154, "arlan1-shm-cpy" }, | ||
1033 | { 155, "config1" }, | ||
1034 | { 156, "reset1" }, | ||
1035 | {} | ||
1036 | }; | ||
1037 | |||
1038 | static const struct trans_ctl_table trans_arlan_conf_table2[] = { | ||
1039 | { 1, "spreadingCode" }, | ||
1040 | { 2, "channelNumber" }, | ||
1041 | { 3, "scramblingDisable" }, | ||
1042 | { 4, "txAttenuation" }, | ||
1043 | { 5, "systemId" }, | ||
1044 | { 6, "maxDatagramSize" }, | ||
1045 | { 7, "maxFrameSize" }, | ||
1046 | { 8, "maxRetries" }, | ||
1047 | { 9, "receiveMode" }, | ||
1048 | { 10, "priority" }, | ||
1049 | { 11, "rootOrRepeater" }, | ||
1050 | { 12, "SID" }, | ||
1051 | { 13, "registrationMode" }, | ||
1052 | { 14, "registrationFill" }, | ||
1053 | { 15, "localTalkAddress" }, | ||
1054 | { 16, "codeFormat" }, | ||
1055 | { 17, "numChannels" }, | ||
1056 | { 18, "channel1" }, | ||
1057 | { 19, "channel2" }, | ||
1058 | { 20, "channel3" }, | ||
1059 | { 21, "channel4" }, | ||
1060 | { 22, "txClear" }, | ||
1061 | { 23, "txRetries" }, | ||
1062 | { 24, "txRouting" }, | ||
1063 | { 25, "txScrambled" }, | ||
1064 | { 26, "rxParameter" }, | ||
1065 | { 27, "txTimeoutMs" }, | ||
1066 | { 28, "waitCardTimeout" }, | ||
1067 | { 29, "channelSet" }, | ||
1068 | { 30, "name" }, | ||
1069 | { 31, "waitTime" }, | ||
1070 | { 32, "lParameter" }, | ||
1071 | { 33, "_15" }, | ||
1072 | { 34, "headerSize" }, | ||
1073 | { 36, "tx_delay_ms" }, | ||
1074 | { 37, "retries" }, | ||
1075 | { 38, "ReTransmitPacketMaxSize" }, | ||
1076 | { 39, "waitReTransmitPacketMaxSize" }, | ||
1077 | { 40, "fastReTransCount" }, | ||
1078 | { 41, "driverRetransmissions" }, | ||
1079 | { 42, "txAckTimeoutMs" }, | ||
1080 | { 43, "registrationInterrupts" }, | ||
1081 | { 44, "hardwareType" }, | ||
1082 | { 45, "radioType" }, | ||
1083 | { 46, "writeEEPROM" }, | ||
1084 | { 47, "writeRadioType" }, | ||
1085 | { 48, "entry_exit_debug" }, | ||
1086 | { 49, "debug" }, | ||
1087 | { 50, "in_speed" }, | ||
1088 | { 51, "out_speed" }, | ||
1089 | { 52, "in_speed10" }, | ||
1090 | { 53, "out_speed10" }, | ||
1091 | { 54, "in_speed_max" }, | ||
1092 | { 55, "out_speed_max" }, | ||
1093 | { 56, "measure_rate" }, | ||
1094 | { 57, "pre_Command_Wait" }, | ||
1095 | { 58, "rx_tweak1" }, | ||
1096 | { 59, "rx_tweak2" }, | ||
1097 | { 60, "tx_queue_len" }, | ||
1098 | |||
1099 | { 150, "arlan2-txRing" }, | ||
1100 | { 151, "arlan2-rxRing" }, | ||
1101 | { 152, "arlan2-18" }, | ||
1102 | { 153, "arlan2-ring" }, | ||
1103 | { 154, "arlan2-shm-cpy" }, | ||
1104 | { 155, "config2" }, | ||
1105 | { 156, "reset2" }, | ||
1106 | {} | ||
1107 | }; | ||
1108 | |||
1109 | static const struct trans_ctl_table trans_arlan_conf_table3[] = { | ||
1110 | { 1, "spreadingCode" }, | ||
1111 | { 2, "channelNumber" }, | ||
1112 | { 3, "scramblingDisable" }, | ||
1113 | { 4, "txAttenuation" }, | ||
1114 | { 5, "systemId" }, | ||
1115 | { 6, "maxDatagramSize" }, | ||
1116 | { 7, "maxFrameSize" }, | ||
1117 | { 8, "maxRetries" }, | ||
1118 | { 9, "receiveMode" }, | ||
1119 | { 10, "priority" }, | ||
1120 | { 11, "rootOrRepeater" }, | ||
1121 | { 12, "SID" }, | ||
1122 | { 13, "registrationMode" }, | ||
1123 | { 14, "registrationFill" }, | ||
1124 | { 15, "localTalkAddress" }, | ||
1125 | { 16, "codeFormat" }, | ||
1126 | { 17, "numChannels" }, | ||
1127 | { 18, "channel1" }, | ||
1128 | { 19, "channel2" }, | ||
1129 | { 20, "channel3" }, | ||
1130 | { 21, "channel4" }, | ||
1131 | { 22, "txClear" }, | ||
1132 | { 23, "txRetries" }, | ||
1133 | { 24, "txRouting" }, | ||
1134 | { 25, "txScrambled" }, | ||
1135 | { 26, "rxParameter" }, | ||
1136 | { 27, "txTimeoutMs" }, | ||
1137 | { 28, "waitCardTimeout" }, | ||
1138 | { 29, "channelSet" }, | ||
1139 | { 30, "name" }, | ||
1140 | { 31, "waitTime" }, | ||
1141 | { 32, "lParameter" }, | ||
1142 | { 33, "_15" }, | ||
1143 | { 34, "headerSize" }, | ||
1144 | { 36, "tx_delay_ms" }, | ||
1145 | { 37, "retries" }, | ||
1146 | { 38, "ReTransmitPacketMaxSize" }, | ||
1147 | { 39, "waitReTransmitPacketMaxSize" }, | ||
1148 | { 40, "fastReTransCount" }, | ||
1149 | { 41, "driverRetransmissions" }, | ||
1150 | { 42, "txAckTimeoutMs" }, | ||
1151 | { 43, "registrationInterrupts" }, | ||
1152 | { 44, "hardwareType" }, | ||
1153 | { 45, "radioType" }, | ||
1154 | { 46, "writeEEPROM" }, | ||
1155 | { 47, "writeRadioType" }, | ||
1156 | { 48, "entry_exit_debug" }, | ||
1157 | { 49, "debug" }, | ||
1158 | { 50, "in_speed" }, | ||
1159 | { 51, "out_speed" }, | ||
1160 | { 52, "in_speed10" }, | ||
1161 | { 53, "out_speed10" }, | ||
1162 | { 54, "in_speed_max" }, | ||
1163 | { 55, "out_speed_max" }, | ||
1164 | { 56, "measure_rate" }, | ||
1165 | { 57, "pre_Command_Wait" }, | ||
1166 | { 58, "rx_tweak1" }, | ||
1167 | { 59, "rx_tweak2" }, | ||
1168 | { 60, "tx_queue_len" }, | ||
1169 | |||
1170 | { 150, "arlan3-txRing" }, | ||
1171 | { 151, "arlan3-rxRing" }, | ||
1172 | { 152, "arlan3-18" }, | ||
1173 | { 153, "arlan3-ring" }, | ||
1174 | { 154, "arlan3-shm-cpy" }, | ||
1175 | { 155, "config3" }, | ||
1176 | { 156, "reset3" }, | ||
1177 | {} | ||
1178 | }; | ||
1179 | |||
1180 | static const struct trans_ctl_table trans_arlan_table[] = { | ||
1181 | { 1, "arlan0", trans_arlan_conf_table0 }, | ||
1182 | { 2, "arlan1", trans_arlan_conf_table1 }, | ||
1183 | { 3, "arlan2", trans_arlan_conf_table2 }, | ||
1184 | { 4, "arlan3", trans_arlan_conf_table3 }, | ||
1185 | {} | ||
1186 | }; | ||
1187 | |||
1188 | static const struct trans_ctl_table trans_s390dbf_table[] = { | ||
1189 | { 5678 /* CTL_S390DBF_STOPPABLE */, "debug_stoppable" }, | ||
1190 | { 5679 /* CTL_S390DBF_ACTIVE */, "debug_active" }, | ||
1191 | {} | ||
1192 | }; | ||
1193 | |||
1194 | static const struct trans_ctl_table trans_sunrpc_table[] = { | ||
1195 | { CTL_RPCDEBUG, "rpc_debug" }, | ||
1196 | { CTL_NFSDEBUG, "nfs_debug" }, | ||
1197 | { CTL_NFSDDEBUG, "nfsd_debug" }, | ||
1198 | { CTL_NLMDEBUG, "nlm_debug" }, | ||
1199 | { CTL_SLOTTABLE_UDP, "udp_slot_table_entries" }, | ||
1200 | { CTL_SLOTTABLE_TCP, "tcp_slot_table_entries" }, | ||
1201 | { CTL_MIN_RESVPORT, "min_resvport" }, | ||
1202 | { CTL_MAX_RESVPORT, "max_resvport" }, | ||
1203 | {} | ||
1204 | }; | ||
1205 | |||
1206 | static const struct trans_ctl_table trans_pm_table[] = { | ||
1207 | { 1 /* CTL_PM_SUSPEND */, "suspend" }, | ||
1208 | { 2 /* CTL_PM_CMODE */, "cmode" }, | ||
1209 | { 3 /* CTL_PM_P0 */, "p0" }, | ||
1210 | { 4 /* CTL_PM_CM */, "cm" }, | ||
1211 | {} | ||
1212 | }; | ||
1213 | |||
1214 | static const struct trans_ctl_table trans_frv_table[] = { | ||
1215 | { 1, "cache-mode" }, | ||
1216 | { 2, "pin-cxnr" }, | ||
1217 | {} | ||
1218 | }; | ||
1219 | |||
1220 | static const struct trans_ctl_table trans_root_table[] = { | ||
1221 | { CTL_KERN, "kernel", trans_kern_table }, | ||
1222 | { CTL_VM, "vm", trans_vm_table }, | ||
1223 | { CTL_NET, "net", trans_net_table }, | ||
1224 | /* CTL_PROC not used */ | ||
1225 | { CTL_FS, "fs", trans_fs_table }, | ||
1226 | { CTL_DEBUG, "debug", trans_debug_table }, | ||
1227 | { CTL_DEV, "dev", trans_dev_table }, | ||
1228 | { CTL_BUS, "bus", trans_bus_table }, | ||
1229 | { CTL_ABI, "abi" }, | ||
1230 | /* CTL_CPU not used */ | ||
1231 | { CTL_ARLAN, "arlan", trans_arlan_table }, | ||
1232 | { CTL_S390DBF, "s390dbf", trans_s390dbf_table }, | ||
1233 | { CTL_SUNRPC, "sunrpc", trans_sunrpc_table }, | ||
1234 | { CTL_PM, "pm", trans_pm_table }, | ||
1235 | { CTL_FRV, "frv", trans_frv_table }, | ||
1236 | {} | ||
1237 | }; | ||
1238 | |||
1239 | |||
1240 | |||
1241 | 8 | ||
1242 | static int sysctl_depth(struct ctl_table *table) | 9 | static int sysctl_depth(struct ctl_table *table) |
1243 | { | 10 | { |
@@ -1261,47 +28,6 @@ static struct ctl_table *sysctl_parent(struct ctl_table *table, int n) | |||
1261 | return table; | 28 | return table; |
1262 | } | 29 | } |
1263 | 30 | ||
1264 | static const struct trans_ctl_table *sysctl_binary_lookup(struct ctl_table *table) | ||
1265 | { | ||
1266 | struct ctl_table *test; | ||
1267 | const struct trans_ctl_table *ref; | ||
1268 | int cur_depth; | ||
1269 | |||
1270 | cur_depth = sysctl_depth(table); | ||
1271 | |||
1272 | ref = trans_root_table; | ||
1273 | repeat: | ||
1274 | test = sysctl_parent(table, cur_depth); | ||
1275 | for (; ref->ctl_name || ref->procname || ref->child; ref++) { | ||
1276 | int match = 0; | ||
1277 | |||
1278 | if (cur_depth && !ref->child) | ||
1279 | continue; | ||
1280 | |||
1281 | if (test->procname && ref->procname && | ||
1282 | (strcmp(test->procname, ref->procname) == 0)) | ||
1283 | match++; | ||
1284 | |||
1285 | if (test->ctl_name && ref->ctl_name && | ||
1286 | (test->ctl_name == ref->ctl_name)) | ||
1287 | match++; | ||
1288 | |||
1289 | if (!ref->ctl_name && !ref->procname) | ||
1290 | match++; | ||
1291 | |||
1292 | if (match) { | ||
1293 | if (cur_depth != 0) { | ||
1294 | cur_depth--; | ||
1295 | ref = ref->child; | ||
1296 | goto repeat; | ||
1297 | } | ||
1298 | goto out; | ||
1299 | } | ||
1300 | } | ||
1301 | ref = NULL; | ||
1302 | out: | ||
1303 | return ref; | ||
1304 | } | ||
1305 | 31 | ||
1306 | static void sysctl_print_path(struct ctl_table *table) | 32 | static void sysctl_print_path(struct ctl_table *table) |
1307 | { | 33 | { |
@@ -1315,26 +41,6 @@ static void sysctl_print_path(struct ctl_table *table) | |||
1315 | } | 41 | } |
1316 | } | 42 | } |
1317 | printk(" "); | 43 | printk(" "); |
1318 | if (table->ctl_name) { | ||
1319 | for (i = depth; i >= 0; i--) { | ||
1320 | tmp = sysctl_parent(table, i); | ||
1321 | printk(".%d", tmp->ctl_name); | ||
1322 | } | ||
1323 | } | ||
1324 | } | ||
1325 | |||
1326 | static void sysctl_repair_table(struct ctl_table *table) | ||
1327 | { | ||
1328 | /* Don't complain about the classic default | ||
1329 | * sysctl strategy routine. Maybe later we | ||
1330 | * can get the tables fixed and complain about | ||
1331 | * this. | ||
1332 | */ | ||
1333 | if (table->ctl_name && table->procname && | ||
1334 | (table->proc_handler == proc_dointvec) && | ||
1335 | (!table->strategy)) { | ||
1336 | table->strategy = sysctl_data; | ||
1337 | } | ||
1338 | } | 44 | } |
1339 | 45 | ||
1340 | static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, | 46 | static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, |
@@ -1352,7 +58,7 @@ static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, | |||
1352 | ref = head->ctl_table; | 58 | ref = head->ctl_table; |
1353 | repeat: | 59 | repeat: |
1354 | test = sysctl_parent(table, cur_depth); | 60 | test = sysctl_parent(table, cur_depth); |
1355 | for (; ref->ctl_name || ref->procname; ref++) { | 61 | for (; ref->procname; ref++) { |
1356 | int match = 0; | 62 | int match = 0; |
1357 | if (cur_depth && !ref->child) | 63 | if (cur_depth && !ref->child) |
1358 | continue; | 64 | continue; |
@@ -1361,10 +67,6 @@ repeat: | |||
1361 | (strcmp(test->procname, ref->procname) == 0)) | 67 | (strcmp(test->procname, ref->procname) == 0)) |
1362 | match++; | 68 | match++; |
1363 | 69 | ||
1364 | if (test->ctl_name && ref->ctl_name && | ||
1365 | (test->ctl_name == ref->ctl_name)) | ||
1366 | match++; | ||
1367 | |||
1368 | if (match) { | 70 | if (match) { |
1369 | if (cur_depth != 0) { | 71 | if (cur_depth != 0) { |
1370 | cur_depth--; | 72 | cur_depth--; |
@@ -1392,38 +94,6 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str | |||
1392 | *fail = str; | 94 | *fail = str; |
1393 | } | 95 | } |
1394 | 96 | ||
1395 | static int sysctl_check_dir(struct nsproxy *namespaces, | ||
1396 | struct ctl_table *table) | ||
1397 | { | ||
1398 | struct ctl_table *ref; | ||
1399 | int error; | ||
1400 | |||
1401 | error = 0; | ||
1402 | ref = sysctl_check_lookup(namespaces, table); | ||
1403 | if (ref) { | ||
1404 | int match = 0; | ||
1405 | if ((!table->procname && !ref->procname) || | ||
1406 | (table->procname && ref->procname && | ||
1407 | (strcmp(table->procname, ref->procname) == 0))) | ||
1408 | match++; | ||
1409 | |||
1410 | if ((!table->ctl_name && !ref->ctl_name) || | ||
1411 | (table->ctl_name && ref->ctl_name && | ||
1412 | (table->ctl_name == ref->ctl_name))) | ||
1413 | match++; | ||
1414 | |||
1415 | if (match != 2) { | ||
1416 | printk(KERN_ERR "%s: failed: ", __func__); | ||
1417 | sysctl_print_path(table); | ||
1418 | printk(" ref: "); | ||
1419 | sysctl_print_path(ref); | ||
1420 | printk("\n"); | ||
1421 | error = -EINVAL; | ||
1422 | } | ||
1423 | } | ||
1424 | return error; | ||
1425 | } | ||
1426 | |||
1427 | static void sysctl_check_leaf(struct nsproxy *namespaces, | 97 | static void sysctl_check_leaf(struct nsproxy *namespaces, |
1428 | struct ctl_table *table, const char **fail) | 98 | struct ctl_table *table, const char **fail) |
1429 | { | 99 | { |
@@ -1434,37 +104,15 @@ static void sysctl_check_leaf(struct nsproxy *namespaces, | |||
1434 | set_fail(fail, table, "Sysctl already exists"); | 104 | set_fail(fail, table, "Sysctl already exists"); |
1435 | } | 105 | } |
1436 | 106 | ||
1437 | static void sysctl_check_bin_path(struct ctl_table *table, const char **fail) | ||
1438 | { | ||
1439 | const struct trans_ctl_table *ref; | ||
1440 | |||
1441 | ref = sysctl_binary_lookup(table); | ||
1442 | if (table->ctl_name && !ref) | ||
1443 | set_fail(fail, table, "Unknown sysctl binary path"); | ||
1444 | if (ref) { | ||
1445 | if (ref->procname && | ||
1446 | (!table->procname || | ||
1447 | (strcmp(table->procname, ref->procname) != 0))) | ||
1448 | set_fail(fail, table, "procname does not match binary path procname"); | ||
1449 | |||
1450 | if (ref->ctl_name && table->ctl_name && | ||
1451 | (table->ctl_name != ref->ctl_name)) | ||
1452 | set_fail(fail, table, "ctl_name does not match binary path ctl_name"); | ||
1453 | } | ||
1454 | } | ||
1455 | |||
1456 | int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | 107 | int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) |
1457 | { | 108 | { |
1458 | int error = 0; | 109 | int error = 0; |
1459 | for (; table->ctl_name || table->procname; table++) { | 110 | for (; table->procname; table++) { |
1460 | const char *fail = NULL; | 111 | const char *fail = NULL; |
1461 | 112 | ||
1462 | sysctl_repair_table(table); | ||
1463 | if (table->parent) { | 113 | if (table->parent) { |
1464 | if (table->procname && !table->parent->procname) | 114 | if (table->procname && !table->parent->procname) |
1465 | set_fail(&fail, table, "Parent without procname"); | 115 | set_fail(&fail, table, "Parent without procname"); |
1466 | if (table->ctl_name && !table->parent->ctl_name) | ||
1467 | set_fail(&fail, table, "Parent without ctl_name"); | ||
1468 | } | 116 | } |
1469 | if (!table->procname) | 117 | if (!table->procname) |
1470 | set_fail(&fail, table, "No procname"); | 118 | set_fail(&fail, table, "No procname"); |
@@ -1477,21 +125,12 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | |||
1477 | set_fail(&fail, table, "Writable sysctl directory"); | 125 | set_fail(&fail, table, "Writable sysctl directory"); |
1478 | if (table->proc_handler) | 126 | if (table->proc_handler) |
1479 | set_fail(&fail, table, "Directory with proc_handler"); | 127 | set_fail(&fail, table, "Directory with proc_handler"); |
1480 | if (table->strategy) | ||
1481 | set_fail(&fail, table, "Directory with strategy"); | ||
1482 | if (table->extra1) | 128 | if (table->extra1) |
1483 | set_fail(&fail, table, "Directory with extra1"); | 129 | set_fail(&fail, table, "Directory with extra1"); |
1484 | if (table->extra2) | 130 | if (table->extra2) |
1485 | set_fail(&fail, table, "Directory with extra2"); | 131 | set_fail(&fail, table, "Directory with extra2"); |
1486 | if (sysctl_check_dir(namespaces, table)) | ||
1487 | set_fail(&fail, table, "Inconsistent directory names"); | ||
1488 | } else { | 132 | } else { |
1489 | if ((table->strategy == sysctl_data) || | 133 | if ((table->proc_handler == proc_dostring) || |
1490 | (table->strategy == sysctl_string) || | ||
1491 | (table->strategy == sysctl_intvec) || | ||
1492 | (table->strategy == sysctl_jiffies) || | ||
1493 | (table->strategy == sysctl_ms_jiffies) || | ||
1494 | (table->proc_handler == proc_dostring) || | ||
1495 | (table->proc_handler == proc_dointvec) || | 134 | (table->proc_handler == proc_dointvec) || |
1496 | (table->proc_handler == proc_dointvec_minmax) || | 135 | (table->proc_handler == proc_dointvec_minmax) || |
1497 | (table->proc_handler == proc_dointvec_jiffies) || | 136 | (table->proc_handler == proc_dointvec_jiffies) || |
@@ -1513,14 +152,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | |||
1513 | set_fail(&fail, table, "No max"); | 152 | set_fail(&fail, table, "No max"); |
1514 | } | 153 | } |
1515 | } | 154 | } |
1516 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
1517 | if (table->ctl_name && !table->strategy) | ||
1518 | set_fail(&fail, table, "Missing strategy"); | ||
1519 | #endif | ||
1520 | #if 0 | ||
1521 | if (!table->ctl_name && table->strategy) | ||
1522 | set_fail(&fail, table, "Strategy without ctl_name"); | ||
1523 | #endif | ||
1524 | #ifdef CONFIG_PROC_SYSCTL | 155 | #ifdef CONFIG_PROC_SYSCTL |
1525 | if (table->procname && !table->proc_handler) | 156 | if (table->procname && !table->proc_handler) |
1526 | set_fail(&fail, table, "No proc_handler"); | 157 | set_fail(&fail, table, "No proc_handler"); |
@@ -1531,7 +162,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | |||
1531 | #endif | 162 | #endif |
1532 | sysctl_check_leaf(namespaces, table, &fail); | 163 | sysctl_check_leaf(namespaces, table, &fail); |
1533 | } | 164 | } |
1534 | sysctl_check_bin_path(table, &fail); | ||
1535 | if (table->mode > 0777) | 165 | if (table->mode > 0777) |
1536 | set_fail(&fail, table, "bogus .mode"); | 166 | set_fail(&fail, table, "bogus .mode"); |
1537 | if (fail) { | 167 | if (fail) { |
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 69eae358a726..a2cd77e70d4d 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c | |||
@@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write, | |||
57 | #define proc_do_uts_string NULL | 57 | #define proc_do_uts_string NULL |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | |||
61 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
62 | /* The generic string strategy routine: */ | ||
63 | static int sysctl_uts_string(ctl_table *table, | ||
64 | void __user *oldval, size_t __user *oldlenp, | ||
65 | void __user *newval, size_t newlen) | ||
66 | { | ||
67 | struct ctl_table uts_table; | ||
68 | int r, write; | ||
69 | write = newval && newlen; | ||
70 | memcpy(&uts_table, table, sizeof(uts_table)); | ||
71 | uts_table.data = get_uts(table, write); | ||
72 | r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen); | ||
73 | put_uts(table, write, uts_table.data); | ||
74 | return r; | ||
75 | } | ||
76 | #else | ||
77 | #define sysctl_uts_string NULL | ||
78 | #endif | ||
79 | |||
80 | static struct ctl_table uts_kern_table[] = { | 60 | static struct ctl_table uts_kern_table[] = { |
81 | { | 61 | { |
82 | .ctl_name = KERN_OSTYPE, | ||
83 | .procname = "ostype", | 62 | .procname = "ostype", |
84 | .data = init_uts_ns.name.sysname, | 63 | .data = init_uts_ns.name.sysname, |
85 | .maxlen = sizeof(init_uts_ns.name.sysname), | 64 | .maxlen = sizeof(init_uts_ns.name.sysname), |
86 | .mode = 0444, | 65 | .mode = 0444, |
87 | .proc_handler = proc_do_uts_string, | 66 | .proc_handler = proc_do_uts_string, |
88 | .strategy = sysctl_uts_string, | ||
89 | }, | 67 | }, |
90 | { | 68 | { |
91 | .ctl_name = KERN_OSRELEASE, | ||
92 | .procname = "osrelease", | 69 | .procname = "osrelease", |
93 | .data = init_uts_ns.name.release, | 70 | .data = init_uts_ns.name.release, |
94 | .maxlen = sizeof(init_uts_ns.name.release), | 71 | .maxlen = sizeof(init_uts_ns.name.release), |
95 | .mode = 0444, | 72 | .mode = 0444, |
96 | .proc_handler = proc_do_uts_string, | 73 | .proc_handler = proc_do_uts_string, |
97 | .strategy = sysctl_uts_string, | ||
98 | }, | 74 | }, |
99 | { | 75 | { |
100 | .ctl_name = KERN_VERSION, | ||
101 | .procname = "version", | 76 | .procname = "version", |
102 | .data = init_uts_ns.name.version, | 77 | .data = init_uts_ns.name.version, |
103 | .maxlen = sizeof(init_uts_ns.name.version), | 78 | .maxlen = sizeof(init_uts_ns.name.version), |
104 | .mode = 0444, | 79 | .mode = 0444, |
105 | .proc_handler = proc_do_uts_string, | 80 | .proc_handler = proc_do_uts_string, |
106 | .strategy = sysctl_uts_string, | ||
107 | }, | 81 | }, |
108 | { | 82 | { |
109 | .ctl_name = KERN_NODENAME, | ||
110 | .procname = "hostname", | 83 | .procname = "hostname", |
111 | .data = init_uts_ns.name.nodename, | 84 | .data = init_uts_ns.name.nodename, |
112 | .maxlen = sizeof(init_uts_ns.name.nodename), | 85 | .maxlen = sizeof(init_uts_ns.name.nodename), |
113 | .mode = 0644, | 86 | .mode = 0644, |
114 | .proc_handler = proc_do_uts_string, | 87 | .proc_handler = proc_do_uts_string, |
115 | .strategy = sysctl_uts_string, | ||
116 | }, | 88 | }, |
117 | { | 89 | { |
118 | .ctl_name = KERN_DOMAINNAME, | ||
119 | .procname = "domainname", | 90 | .procname = "domainname", |
120 | .data = init_uts_ns.name.domainname, | 91 | .data = init_uts_ns.name.domainname, |
121 | .maxlen = sizeof(init_uts_ns.name.domainname), | 92 | .maxlen = sizeof(init_uts_ns.name.domainname), |
122 | .mode = 0644, | 93 | .mode = 0644, |
123 | .proc_handler = proc_do_uts_string, | 94 | .proc_handler = proc_do_uts_string, |
124 | .strategy = sysctl_uts_string, | ||
125 | }, | 95 | }, |
126 | {} | 96 | {} |
127 | }; | 97 | }; |
128 | 98 | ||
129 | static struct ctl_table uts_root_table[] = { | 99 | static struct ctl_table uts_root_table[] = { |
130 | { | 100 | { |
131 | .ctl_name = CTL_KERN, | ||
132 | .procname = "kernel", | 101 | .procname = "kernel", |
133 | .mode = 0555, | 102 | .mode = 0555, |
134 | .child = uts_kern_table, | 103 | .child = uts_kern_table, |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index a79c4d0407ab..0b8f35918a36 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -912,7 +912,7 @@ config LATENCYTOP | |||
912 | 912 | ||
913 | config SYSCTL_SYSCALL_CHECK | 913 | config SYSCTL_SYSCALL_CHECK |
914 | bool "Sysctl checks" | 914 | bool "Sysctl checks" |
915 | depends on SYSCTL_SYSCALL | 915 | depends on SYSCTL |
916 | ---help--- | 916 | ---help--- |
917 | sys_sysctl uses binary paths that have been found challenging | 917 | sys_sysctl uses binary paths that have been found challenging |
918 | to properly maintain and use. This enables checks that help | 918 | to properly maintain and use. This enables checks that help |
diff --git a/net/802/tr.c b/net/802/tr.c index e874447ad144..44acce47fcdc 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -635,19 +635,18 @@ struct net_device *alloc_trdev(int sizeof_priv) | |||
635 | #ifdef CONFIG_SYSCTL | 635 | #ifdef CONFIG_SYSCTL |
636 | static struct ctl_table tr_table[] = { | 636 | static struct ctl_table tr_table[] = { |
637 | { | 637 | { |
638 | .ctl_name = NET_TR_RIF_TIMEOUT, | ||
639 | .procname = "rif_timeout", | 638 | .procname = "rif_timeout", |
640 | .data = &sysctl_tr_rif_timeout, | 639 | .data = &sysctl_tr_rif_timeout, |
641 | .maxlen = sizeof(int), | 640 | .maxlen = sizeof(int), |
642 | .mode = 0644, | 641 | .mode = 0644, |
643 | .proc_handler = proc_dointvec | 642 | .proc_handler = proc_dointvec |
644 | }, | 643 | }, |
645 | { 0 }, | 644 | { }, |
646 | }; | 645 | }; |
647 | 646 | ||
648 | static __initdata struct ctl_path tr_path[] = { | 647 | static __initdata struct ctl_path tr_path[] = { |
649 | { .procname = "net", .ctl_name = CTL_NET, }, | 648 | { .procname = "net", }, |
650 | { .procname = "token-ring", .ctl_name = NET_TR, }, | 649 | { .procname = "token-ring", }, |
651 | { } | 650 | { } |
652 | }; | 651 | }; |
653 | #endif | 652 | #endif |
diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c index 8d237b15183b..04e9c0da7aa9 100644 --- a/net/appletalk/sysctl_net_atalk.c +++ b/net/appletalk/sysctl_net_atalk.c | |||
@@ -12,25 +12,20 @@ | |||
12 | 12 | ||
13 | static struct ctl_table atalk_table[] = { | 13 | static struct ctl_table atalk_table[] = { |
14 | { | 14 | { |
15 | .ctl_name = NET_ATALK_AARP_EXPIRY_TIME, | ||
16 | .procname = "aarp-expiry-time", | 15 | .procname = "aarp-expiry-time", |
17 | .data = &sysctl_aarp_expiry_time, | 16 | .data = &sysctl_aarp_expiry_time, |
18 | .maxlen = sizeof(int), | 17 | .maxlen = sizeof(int), |
19 | .mode = 0644, | 18 | .mode = 0644, |
20 | .proc_handler = proc_dointvec_jiffies, | 19 | .proc_handler = proc_dointvec_jiffies, |
21 | .strategy = sysctl_jiffies, | ||
22 | }, | 20 | }, |
23 | { | 21 | { |
24 | .ctl_name = NET_ATALK_AARP_TICK_TIME, | ||
25 | .procname = "aarp-tick-time", | 22 | .procname = "aarp-tick-time", |
26 | .data = &sysctl_aarp_tick_time, | 23 | .data = &sysctl_aarp_tick_time, |
27 | .maxlen = sizeof(int), | 24 | .maxlen = sizeof(int), |
28 | .mode = 0644, | 25 | .mode = 0644, |
29 | .proc_handler = proc_dointvec_jiffies, | 26 | .proc_handler = proc_dointvec_jiffies, |
30 | .strategy = sysctl_jiffies, | ||
31 | }, | 27 | }, |
32 | { | 28 | { |
33 | .ctl_name = NET_ATALK_AARP_RETRANSMIT_LIMIT, | ||
34 | .procname = "aarp-retransmit-limit", | 29 | .procname = "aarp-retransmit-limit", |
35 | .data = &sysctl_aarp_retransmit_limit, | 30 | .data = &sysctl_aarp_retransmit_limit, |
36 | .maxlen = sizeof(int), | 31 | .maxlen = sizeof(int), |
@@ -38,20 +33,18 @@ static struct ctl_table atalk_table[] = { | |||
38 | .proc_handler = proc_dointvec, | 33 | .proc_handler = proc_dointvec, |
39 | }, | 34 | }, |
40 | { | 35 | { |
41 | .ctl_name = NET_ATALK_AARP_RESOLVE_TIME, | ||
42 | .procname = "aarp-resolve-time", | 36 | .procname = "aarp-resolve-time", |
43 | .data = &sysctl_aarp_resolve_time, | 37 | .data = &sysctl_aarp_resolve_time, |
44 | .maxlen = sizeof(int), | 38 | .maxlen = sizeof(int), |
45 | .mode = 0644, | 39 | .mode = 0644, |
46 | .proc_handler = proc_dointvec_jiffies, | 40 | .proc_handler = proc_dointvec_jiffies, |
47 | .strategy = sysctl_jiffies, | ||
48 | }, | 41 | }, |
49 | { 0 }, | 42 | { }, |
50 | }; | 43 | }; |
51 | 44 | ||
52 | static struct ctl_path atalk_path[] = { | 45 | static struct ctl_path atalk_path[] = { |
53 | { .procname = "net", .ctl_name = CTL_NET, }, | 46 | { .procname = "net", }, |
54 | { .procname = "appletalk", .ctl_name = NET_ATALK, }, | 47 | { .procname = "appletalk", }, |
55 | { } | 48 | { } |
56 | }; | 49 | }; |
57 | 50 | ||
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c index 62ee3fb34732..5159be6b2625 100644 --- a/net/ax25/sysctl_net_ax25.c +++ b/net/ax25/sysctl_net_ax25.c | |||
@@ -34,156 +34,128 @@ static ctl_table *ax25_table; | |||
34 | static int ax25_table_size; | 34 | static int ax25_table_size; |
35 | 35 | ||
36 | static struct ctl_path ax25_path[] = { | 36 | static struct ctl_path ax25_path[] = { |
37 | { .procname = "net", .ctl_name = CTL_NET, }, | 37 | { .procname = "net", }, |
38 | { .procname = "ax25", .ctl_name = NET_AX25, }, | 38 | { .procname = "ax25", }, |
39 | { } | 39 | { } |
40 | }; | 40 | }; |
41 | 41 | ||
42 | static const ctl_table ax25_param_table[] = { | 42 | static const ctl_table ax25_param_table[] = { |
43 | { | 43 | { |
44 | .ctl_name = NET_AX25_IP_DEFAULT_MODE, | ||
45 | .procname = "ip_default_mode", | 44 | .procname = "ip_default_mode", |
46 | .maxlen = sizeof(int), | 45 | .maxlen = sizeof(int), |
47 | .mode = 0644, | 46 | .mode = 0644, |
48 | .proc_handler = proc_dointvec_minmax, | 47 | .proc_handler = proc_dointvec_minmax, |
49 | .strategy = sysctl_intvec, | ||
50 | .extra1 = &min_ipdefmode, | 48 | .extra1 = &min_ipdefmode, |
51 | .extra2 = &max_ipdefmode | 49 | .extra2 = &max_ipdefmode |
52 | }, | 50 | }, |
53 | { | 51 | { |
54 | .ctl_name = NET_AX25_DEFAULT_MODE, | ||
55 | .procname = "ax25_default_mode", | 52 | .procname = "ax25_default_mode", |
56 | .maxlen = sizeof(int), | 53 | .maxlen = sizeof(int), |
57 | .mode = 0644, | 54 | .mode = 0644, |
58 | .proc_handler = proc_dointvec_minmax, | 55 | .proc_handler = proc_dointvec_minmax, |
59 | .strategy = sysctl_intvec, | ||
60 | .extra1 = &min_axdefmode, | 56 | .extra1 = &min_axdefmode, |
61 | .extra2 = &max_axdefmode | 57 | .extra2 = &max_axdefmode |
62 | }, | 58 | }, |
63 | { | 59 | { |
64 | .ctl_name = NET_AX25_BACKOFF_TYPE, | ||
65 | .procname = "backoff_type", | 60 | .procname = "backoff_type", |
66 | .maxlen = sizeof(int), | 61 | .maxlen = sizeof(int), |
67 | .mode = 0644, | 62 | .mode = 0644, |
68 | .proc_handler = proc_dointvec_minmax, | 63 | .proc_handler = proc_dointvec_minmax, |
69 | .strategy = sysctl_intvec, | ||
70 | .extra1 = &min_backoff, | 64 | .extra1 = &min_backoff, |
71 | .extra2 = &max_backoff | 65 | .extra2 = &max_backoff |
72 | }, | 66 | }, |
73 | { | 67 | { |
74 | .ctl_name = NET_AX25_CONNECT_MODE, | ||
75 | .procname = "connect_mode", | 68 | .procname = "connect_mode", |
76 | .maxlen = sizeof(int), | 69 | .maxlen = sizeof(int), |
77 | .mode = 0644, | 70 | .mode = 0644, |
78 | .proc_handler = proc_dointvec_minmax, | 71 | .proc_handler = proc_dointvec_minmax, |
79 | .strategy = sysctl_intvec, | ||
80 | .extra1 = &min_conmode, | 72 | .extra1 = &min_conmode, |
81 | .extra2 = &max_conmode | 73 | .extra2 = &max_conmode |
82 | }, | 74 | }, |
83 | { | 75 | { |
84 | .ctl_name = NET_AX25_STANDARD_WINDOW, | ||
85 | .procname = "standard_window_size", | 76 | .procname = "standard_window_size", |
86 | .maxlen = sizeof(int), | 77 | .maxlen = sizeof(int), |
87 | .mode = 0644, | 78 | .mode = 0644, |
88 | .proc_handler = proc_dointvec_minmax, | 79 | .proc_handler = proc_dointvec_minmax, |
89 | .strategy = sysctl_intvec, | ||
90 | .extra1 = &min_window, | 80 | .extra1 = &min_window, |
91 | .extra2 = &max_window | 81 | .extra2 = &max_window |
92 | }, | 82 | }, |
93 | { | 83 | { |
94 | .ctl_name = NET_AX25_EXTENDED_WINDOW, | ||
95 | .procname = "extended_window_size", | 84 | .procname = "extended_window_size", |
96 | .maxlen = sizeof(int), | 85 | .maxlen = sizeof(int), |
97 | .mode = 0644, | 86 | .mode = 0644, |
98 | .proc_handler = proc_dointvec_minmax, | 87 | .proc_handler = proc_dointvec_minmax, |
99 | .strategy = sysctl_intvec, | ||
100 | .extra1 = &min_ewindow, | 88 | .extra1 = &min_ewindow, |
101 | .extra2 = &max_ewindow | 89 | .extra2 = &max_ewindow |
102 | }, | 90 | }, |
103 | { | 91 | { |
104 | .ctl_name = NET_AX25_T1_TIMEOUT, | ||
105 | .procname = "t1_timeout", | 92 | .procname = "t1_timeout", |
106 | .maxlen = sizeof(int), | 93 | .maxlen = sizeof(int), |
107 | .mode = 0644, | 94 | .mode = 0644, |
108 | .proc_handler = proc_dointvec_minmax, | 95 | .proc_handler = proc_dointvec_minmax, |
109 | .strategy = sysctl_intvec, | ||
110 | .extra1 = &min_t1, | 96 | .extra1 = &min_t1, |
111 | .extra2 = &max_t1 | 97 | .extra2 = &max_t1 |
112 | }, | 98 | }, |
113 | { | 99 | { |
114 | .ctl_name = NET_AX25_T2_TIMEOUT, | ||
115 | .procname = "t2_timeout", | 100 | .procname = "t2_timeout", |
116 | .maxlen = sizeof(int), | 101 | .maxlen = sizeof(int), |
117 | .mode = 0644, | 102 | .mode = 0644, |
118 | .proc_handler = proc_dointvec_minmax, | 103 | .proc_handler = proc_dointvec_minmax, |
119 | .strategy = sysctl_intvec, | ||
120 | .extra1 = &min_t2, | 104 | .extra1 = &min_t2, |
121 | .extra2 = &max_t2 | 105 | .extra2 = &max_t2 |
122 | }, | 106 | }, |
123 | { | 107 | { |
124 | .ctl_name = NET_AX25_T3_TIMEOUT, | ||
125 | .procname = "t3_timeout", | 108 | .procname = "t3_timeout", |
126 | .maxlen = sizeof(int), | 109 | .maxlen = sizeof(int), |
127 | .mode = 0644, | 110 | .mode = 0644, |
128 | .proc_handler = proc_dointvec_minmax, | 111 | .proc_handler = proc_dointvec_minmax, |
129 | .strategy = sysctl_intvec, | ||
130 | .extra1 = &min_t3, | 112 | .extra1 = &min_t3, |
131 | .extra2 = &max_t3 | 113 | .extra2 = &max_t3 |
132 | }, | 114 | }, |
133 | { | 115 | { |
134 | .ctl_name = NET_AX25_IDLE_TIMEOUT, | ||
135 | .procname = "idle_timeout", | 116 | .procname = "idle_timeout", |
136 | .maxlen = sizeof(int), | 117 | .maxlen = sizeof(int), |
137 | .mode = 0644, | 118 | .mode = 0644, |
138 | .proc_handler = proc_dointvec_minmax, | 119 | .proc_handler = proc_dointvec_minmax, |
139 | .strategy = sysctl_intvec, | ||
140 | .extra1 = &min_idle, | 120 | .extra1 = &min_idle, |
141 | .extra2 = &max_idle | 121 | .extra2 = &max_idle |
142 | }, | 122 | }, |
143 | { | 123 | { |
144 | .ctl_name = NET_AX25_N2, | ||
145 | .procname = "maximum_retry_count", | 124 | .procname = "maximum_retry_count", |
146 | .maxlen = sizeof(int), | 125 | .maxlen = sizeof(int), |
147 | .mode = 0644, | 126 | .mode = 0644, |
148 | .proc_handler = proc_dointvec_minmax, | 127 | .proc_handler = proc_dointvec_minmax, |
149 | .strategy = sysctl_intvec, | ||
150 | .extra1 = &min_n2, | 128 | .extra1 = &min_n2, |
151 | .extra2 = &max_n2 | 129 | .extra2 = &max_n2 |
152 | }, | 130 | }, |
153 | { | 131 | { |
154 | .ctl_name = NET_AX25_PACLEN, | ||
155 | .procname = "maximum_packet_length", | 132 | .procname = "maximum_packet_length", |
156 | .maxlen = sizeof(int), | 133 | .maxlen = sizeof(int), |
157 | .mode = 0644, | 134 | .mode = 0644, |
158 | .proc_handler = proc_dointvec_minmax, | 135 | .proc_handler = proc_dointvec_minmax, |
159 | .strategy = sysctl_intvec, | ||
160 | .extra1 = &min_paclen, | 136 | .extra1 = &min_paclen, |
161 | .extra2 = &max_paclen | 137 | .extra2 = &max_paclen |
162 | }, | 138 | }, |
163 | { | 139 | { |
164 | .ctl_name = NET_AX25_PROTOCOL, | ||
165 | .procname = "protocol", | 140 | .procname = "protocol", |
166 | .maxlen = sizeof(int), | 141 | .maxlen = sizeof(int), |
167 | .mode = 0644, | 142 | .mode = 0644, |
168 | .proc_handler = proc_dointvec_minmax, | 143 | .proc_handler = proc_dointvec_minmax, |
169 | .strategy = sysctl_intvec, | ||
170 | .extra1 = &min_proto, | 144 | .extra1 = &min_proto, |
171 | .extra2 = &max_proto | 145 | .extra2 = &max_proto |
172 | }, | 146 | }, |
173 | #ifdef CONFIG_AX25_DAMA_SLAVE | 147 | #ifdef CONFIG_AX25_DAMA_SLAVE |
174 | { | 148 | { |
175 | .ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT, | ||
176 | .procname = "dama_slave_timeout", | 149 | .procname = "dama_slave_timeout", |
177 | .maxlen = sizeof(int), | 150 | .maxlen = sizeof(int), |
178 | .mode = 0644, | 151 | .mode = 0644, |
179 | .proc_handler = proc_dointvec_minmax, | 152 | .proc_handler = proc_dointvec_minmax, |
180 | .strategy = sysctl_intvec, | ||
181 | .extra1 = &min_ds_timeout, | 153 | .extra1 = &min_ds_timeout, |
182 | .extra2 = &max_ds_timeout | 154 | .extra2 = &max_ds_timeout |
183 | }, | 155 | }, |
184 | #endif | 156 | #endif |
185 | 157 | ||
186 | { .ctl_name = 0 } /* that's all, folks! */ | 158 | { } /* that's all, folks! */ |
187 | }; | 159 | }; |
188 | 160 | ||
189 | void ax25_register_sysctl(void) | 161 | void ax25_register_sysctl(void) |
@@ -212,11 +184,9 @@ void ax25_register_sysctl(void) | |||
212 | return; | 184 | return; |
213 | } | 185 | } |
214 | ax25_table[n].child = ax25_dev->systable = child; | 186 | ax25_table[n].child = ax25_dev->systable = child; |
215 | ax25_table[n].ctl_name = n + 1; | ||
216 | ax25_table[n].procname = ax25_dev->dev->name; | 187 | ax25_table[n].procname = ax25_dev->dev->name; |
217 | ax25_table[n].mode = 0555; | 188 | ax25_table[n].mode = 0555; |
218 | 189 | ||
219 | child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */ | ||
220 | 190 | ||
221 | for (k = 0; k < AX25_MAX_VALUES; k++) | 191 | for (k = 0; k < AX25_MAX_VALUES; k++) |
222 | child[k].data = &ax25_dev->values[k]; | 192 | child[k].data = &ax25_dev->values[k]; |
@@ -233,7 +203,7 @@ void ax25_unregister_sysctl(void) | |||
233 | ctl_table *p; | 203 | ctl_table *p; |
234 | unregister_sysctl_table(ax25_table_header); | 204 | unregister_sysctl_table(ax25_table_header); |
235 | 205 | ||
236 | for (p = ax25_table; p->ctl_name; p++) | 206 | for (p = ax25_table; p->procname; p++) |
237 | kfree(p->child); | 207 | kfree(p->child); |
238 | kfree(ax25_table); | 208 | kfree(ax25_table); |
239 | } | 209 | } |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index a16a2342f6bf..268e2e725888 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -1013,12 +1013,12 @@ static ctl_table brnf_table[] = { | |||
1013 | .mode = 0644, | 1013 | .mode = 0644, |
1014 | .proc_handler = brnf_sysctl_call_tables, | 1014 | .proc_handler = brnf_sysctl_call_tables, |
1015 | }, | 1015 | }, |
1016 | { .ctl_name = 0 } | 1016 | { } |
1017 | }; | 1017 | }; |
1018 | 1018 | ||
1019 | static struct ctl_path brnf_path[] = { | 1019 | static struct ctl_path brnf_path[] = { |
1020 | { .procname = "net", .ctl_name = CTL_NET, }, | 1020 | { .procname = "net", }, |
1021 | { .procname = "bridge", .ctl_name = NET_BRIDGE, }, | 1021 | { .procname = "bridge", }, |
1022 | { } | 1022 | { } |
1023 | }; | 1023 | }; |
1024 | #endif | 1024 | #endif |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index e587e6819698..2b54e6c6a7c8 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2566,21 +2566,18 @@ static struct neigh_sysctl_table { | |||
2566 | } neigh_sysctl_template __read_mostly = { | 2566 | } neigh_sysctl_template __read_mostly = { |
2567 | .neigh_vars = { | 2567 | .neigh_vars = { |
2568 | { | 2568 | { |
2569 | .ctl_name = NET_NEIGH_MCAST_SOLICIT, | ||
2570 | .procname = "mcast_solicit", | 2569 | .procname = "mcast_solicit", |
2571 | .maxlen = sizeof(int), | 2570 | .maxlen = sizeof(int), |
2572 | .mode = 0644, | 2571 | .mode = 0644, |
2573 | .proc_handler = proc_dointvec, | 2572 | .proc_handler = proc_dointvec, |
2574 | }, | 2573 | }, |
2575 | { | 2574 | { |
2576 | .ctl_name = NET_NEIGH_UCAST_SOLICIT, | ||
2577 | .procname = "ucast_solicit", | 2575 | .procname = "ucast_solicit", |
2578 | .maxlen = sizeof(int), | 2576 | .maxlen = sizeof(int), |
2579 | .mode = 0644, | 2577 | .mode = 0644, |
2580 | .proc_handler = proc_dointvec, | 2578 | .proc_handler = proc_dointvec, |
2581 | }, | 2579 | }, |
2582 | { | 2580 | { |
2583 | .ctl_name = NET_NEIGH_APP_SOLICIT, | ||
2584 | .procname = "app_solicit", | 2581 | .procname = "app_solicit", |
2585 | .maxlen = sizeof(int), | 2582 | .maxlen = sizeof(int), |
2586 | .mode = 0644, | 2583 | .mode = 0644, |
@@ -2593,38 +2590,30 @@ static struct neigh_sysctl_table { | |||
2593 | .proc_handler = proc_dointvec_userhz_jiffies, | 2590 | .proc_handler = proc_dointvec_userhz_jiffies, |
2594 | }, | 2591 | }, |
2595 | { | 2592 | { |
2596 | .ctl_name = NET_NEIGH_REACHABLE_TIME, | ||
2597 | .procname = "base_reachable_time", | 2593 | .procname = "base_reachable_time", |
2598 | .maxlen = sizeof(int), | 2594 | .maxlen = sizeof(int), |
2599 | .mode = 0644, | 2595 | .mode = 0644, |
2600 | .proc_handler = proc_dointvec_jiffies, | 2596 | .proc_handler = proc_dointvec_jiffies, |
2601 | .strategy = sysctl_jiffies, | ||
2602 | }, | 2597 | }, |
2603 | { | 2598 | { |
2604 | .ctl_name = NET_NEIGH_DELAY_PROBE_TIME, | ||
2605 | .procname = "delay_first_probe_time", | 2599 | .procname = "delay_first_probe_time", |
2606 | .maxlen = sizeof(int), | 2600 | .maxlen = sizeof(int), |
2607 | .mode = 0644, | 2601 | .mode = 0644, |
2608 | .proc_handler = proc_dointvec_jiffies, | 2602 | .proc_handler = proc_dointvec_jiffies, |
2609 | .strategy = sysctl_jiffies, | ||
2610 | }, | 2603 | }, |
2611 | { | 2604 | { |
2612 | .ctl_name = NET_NEIGH_GC_STALE_TIME, | ||
2613 | .procname = "gc_stale_time", | 2605 | .procname = "gc_stale_time", |
2614 | .maxlen = sizeof(int), | 2606 | .maxlen = sizeof(int), |
2615 | .mode = 0644, | 2607 | .mode = 0644, |
2616 | .proc_handler = proc_dointvec_jiffies, | 2608 | .proc_handler = proc_dointvec_jiffies, |
2617 | .strategy = sysctl_jiffies, | ||
2618 | }, | 2609 | }, |
2619 | { | 2610 | { |
2620 | .ctl_name = NET_NEIGH_UNRES_QLEN, | ||
2621 | .procname = "unres_qlen", | 2611 | .procname = "unres_qlen", |
2622 | .maxlen = sizeof(int), | 2612 | .maxlen = sizeof(int), |
2623 | .mode = 0644, | 2613 | .mode = 0644, |
2624 | .proc_handler = proc_dointvec, | 2614 | .proc_handler = proc_dointvec, |
2625 | }, | 2615 | }, |
2626 | { | 2616 | { |
2627 | .ctl_name = NET_NEIGH_PROXY_QLEN, | ||
2628 | .procname = "proxy_qlen", | 2617 | .procname = "proxy_qlen", |
2629 | .maxlen = sizeof(int), | 2618 | .maxlen = sizeof(int), |
2630 | .mode = 0644, | 2619 | .mode = 0644, |
@@ -2649,45 +2638,36 @@ static struct neigh_sysctl_table { | |||
2649 | .proc_handler = proc_dointvec_userhz_jiffies, | 2638 | .proc_handler = proc_dointvec_userhz_jiffies, |
2650 | }, | 2639 | }, |
2651 | { | 2640 | { |
2652 | .ctl_name = NET_NEIGH_RETRANS_TIME_MS, | ||
2653 | .procname = "retrans_time_ms", | 2641 | .procname = "retrans_time_ms", |
2654 | .maxlen = sizeof(int), | 2642 | .maxlen = sizeof(int), |
2655 | .mode = 0644, | 2643 | .mode = 0644, |
2656 | .proc_handler = proc_dointvec_ms_jiffies, | 2644 | .proc_handler = proc_dointvec_ms_jiffies, |
2657 | .strategy = sysctl_ms_jiffies, | ||
2658 | }, | 2645 | }, |
2659 | { | 2646 | { |
2660 | .ctl_name = NET_NEIGH_REACHABLE_TIME_MS, | ||
2661 | .procname = "base_reachable_time_ms", | 2647 | .procname = "base_reachable_time_ms", |
2662 | .maxlen = sizeof(int), | 2648 | .maxlen = sizeof(int), |
2663 | .mode = 0644, | 2649 | .mode = 0644, |
2664 | .proc_handler = proc_dointvec_ms_jiffies, | 2650 | .proc_handler = proc_dointvec_ms_jiffies, |
2665 | .strategy = sysctl_ms_jiffies, | ||
2666 | }, | 2651 | }, |
2667 | { | 2652 | { |
2668 | .ctl_name = NET_NEIGH_GC_INTERVAL, | ||
2669 | .procname = "gc_interval", | 2653 | .procname = "gc_interval", |
2670 | .maxlen = sizeof(int), | 2654 | .maxlen = sizeof(int), |
2671 | .mode = 0644, | 2655 | .mode = 0644, |
2672 | .proc_handler = proc_dointvec_jiffies, | 2656 | .proc_handler = proc_dointvec_jiffies, |
2673 | .strategy = sysctl_jiffies, | ||
2674 | }, | 2657 | }, |
2675 | { | 2658 | { |
2676 | .ctl_name = NET_NEIGH_GC_THRESH1, | ||
2677 | .procname = "gc_thresh1", | 2659 | .procname = "gc_thresh1", |
2678 | .maxlen = sizeof(int), | 2660 | .maxlen = sizeof(int), |
2679 | .mode = 0644, | 2661 | .mode = 0644, |
2680 | .proc_handler = proc_dointvec, | 2662 | .proc_handler = proc_dointvec, |
2681 | }, | 2663 | }, |
2682 | { | 2664 | { |
2683 | .ctl_name = NET_NEIGH_GC_THRESH2, | ||
2684 | .procname = "gc_thresh2", | 2665 | .procname = "gc_thresh2", |
2685 | .maxlen = sizeof(int), | 2666 | .maxlen = sizeof(int), |
2686 | .mode = 0644, | 2667 | .mode = 0644, |
2687 | .proc_handler = proc_dointvec, | 2668 | .proc_handler = proc_dointvec, |
2688 | }, | 2669 | }, |
2689 | { | 2670 | { |
2690 | .ctl_name = NET_NEIGH_GC_THRESH3, | ||
2691 | .procname = "gc_thresh3", | 2671 | .procname = "gc_thresh3", |
2692 | .maxlen = sizeof(int), | 2672 | .maxlen = sizeof(int), |
2693 | .mode = 0644, | 2673 | .mode = 0644, |
@@ -2699,7 +2679,7 @@ static struct neigh_sysctl_table { | |||
2699 | 2679 | ||
2700 | int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | 2680 | int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, |
2701 | int p_id, int pdev_id, char *p_name, | 2681 | int p_id, int pdev_id, char *p_name, |
2702 | proc_handler *handler, ctl_handler *strategy) | 2682 | proc_handler *handler) |
2703 | { | 2683 | { |
2704 | struct neigh_sysctl_table *t; | 2684 | struct neigh_sysctl_table *t; |
2705 | const char *dev_name_source = NULL; | 2685 | const char *dev_name_source = NULL; |
@@ -2710,10 +2690,10 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | |||
2710 | #define NEIGH_CTL_PATH_DEV 3 | 2690 | #define NEIGH_CTL_PATH_DEV 3 |
2711 | 2691 | ||
2712 | struct ctl_path neigh_path[] = { | 2692 | struct ctl_path neigh_path[] = { |
2713 | { .procname = "net", .ctl_name = CTL_NET, }, | 2693 | { .procname = "net", }, |
2714 | { .procname = "proto", .ctl_name = 0, }, | 2694 | { .procname = "proto", }, |
2715 | { .procname = "neigh", .ctl_name = 0, }, | 2695 | { .procname = "neigh", }, |
2716 | { .procname = "default", .ctl_name = NET_PROTO_CONF_DEFAULT, }, | 2696 | { .procname = "default", }, |
2717 | { }, | 2697 | { }, |
2718 | }; | 2698 | }; |
2719 | 2699 | ||
@@ -2738,7 +2718,6 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | |||
2738 | 2718 | ||
2739 | if (dev) { | 2719 | if (dev) { |
2740 | dev_name_source = dev->name; | 2720 | dev_name_source = dev->name; |
2741 | neigh_path[NEIGH_CTL_PATH_DEV].ctl_name = dev->ifindex; | ||
2742 | /* Terminate the table early */ | 2721 | /* Terminate the table early */ |
2743 | memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14])); | 2722 | memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14])); |
2744 | } else { | 2723 | } else { |
@@ -2750,31 +2729,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | |||
2750 | } | 2729 | } |
2751 | 2730 | ||
2752 | 2731 | ||
2753 | if (handler || strategy) { | 2732 | if (handler) { |
2754 | /* RetransTime */ | 2733 | /* RetransTime */ |
2755 | t->neigh_vars[3].proc_handler = handler; | 2734 | t->neigh_vars[3].proc_handler = handler; |
2756 | t->neigh_vars[3].strategy = strategy; | ||
2757 | t->neigh_vars[3].extra1 = dev; | 2735 | t->neigh_vars[3].extra1 = dev; |
2758 | if (!strategy) | ||
2759 | t->neigh_vars[3].ctl_name = CTL_UNNUMBERED; | ||
2760 | /* ReachableTime */ | 2736 | /* ReachableTime */ |
2761 | t->neigh_vars[4].proc_handler = handler; | 2737 | t->neigh_vars[4].proc_handler = handler; |
2762 | t->neigh_vars[4].strategy = strategy; | ||
2763 | t->neigh_vars[4].extra1 = dev; | 2738 | t->neigh_vars[4].extra1 = dev; |
2764 | if (!strategy) | ||
2765 | t->neigh_vars[4].ctl_name = CTL_UNNUMBERED; | ||
2766 | /* RetransTime (in milliseconds)*/ | 2739 | /* RetransTime (in milliseconds)*/ |
2767 | t->neigh_vars[12].proc_handler = handler; | 2740 | t->neigh_vars[12].proc_handler = handler; |
2768 | t->neigh_vars[12].strategy = strategy; | ||
2769 | t->neigh_vars[12].extra1 = dev; | 2741 | t->neigh_vars[12].extra1 = dev; |
2770 | if (!strategy) | ||
2771 | t->neigh_vars[12].ctl_name = CTL_UNNUMBERED; | ||
2772 | /* ReachableTime (in milliseconds) */ | 2742 | /* ReachableTime (in milliseconds) */ |
2773 | t->neigh_vars[13].proc_handler = handler; | 2743 | t->neigh_vars[13].proc_handler = handler; |
2774 | t->neigh_vars[13].strategy = strategy; | ||
2775 | t->neigh_vars[13].extra1 = dev; | 2744 | t->neigh_vars[13].extra1 = dev; |
2776 | if (!strategy) | ||
2777 | t->neigh_vars[13].ctl_name = CTL_UNNUMBERED; | ||
2778 | } | 2745 | } |
2779 | 2746 | ||
2780 | t->dev_name = kstrdup(dev_name_source, GFP_KERNEL); | 2747 | 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, | |||
2782 | goto free; | 2749 | goto free; |
2783 | 2750 | ||
2784 | neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name; | 2751 | neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name; |
2785 | neigh_path[NEIGH_CTL_PATH_NEIGH].ctl_name = pdev_id; | ||
2786 | neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name; | 2752 | neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name; |
2787 | neigh_path[NEIGH_CTL_PATH_PROTO].ctl_name = p_id; | ||
2788 | 2753 | ||
2789 | t->sysctl_header = | 2754 | t->sysctl_header = |
2790 | register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars); | 2755 | register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars); |
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 887c03c4e3c6..267314664813 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c | |||
@@ -19,7 +19,6 @@ | |||
19 | static struct ctl_table net_core_table[] = { | 19 | static struct ctl_table net_core_table[] = { |
20 | #ifdef CONFIG_NET | 20 | #ifdef CONFIG_NET |
21 | { | 21 | { |
22 | .ctl_name = NET_CORE_WMEM_MAX, | ||
23 | .procname = "wmem_max", | 22 | .procname = "wmem_max", |
24 | .data = &sysctl_wmem_max, | 23 | .data = &sysctl_wmem_max, |
25 | .maxlen = sizeof(int), | 24 | .maxlen = sizeof(int), |
@@ -27,7 +26,6 @@ static struct ctl_table net_core_table[] = { | |||
27 | .proc_handler = proc_dointvec | 26 | .proc_handler = proc_dointvec |
28 | }, | 27 | }, |
29 | { | 28 | { |
30 | .ctl_name = NET_CORE_RMEM_MAX, | ||
31 | .procname = "rmem_max", | 29 | .procname = "rmem_max", |
32 | .data = &sysctl_rmem_max, | 30 | .data = &sysctl_rmem_max, |
33 | .maxlen = sizeof(int), | 31 | .maxlen = sizeof(int), |
@@ -35,7 +33,6 @@ static struct ctl_table net_core_table[] = { | |||
35 | .proc_handler = proc_dointvec | 33 | .proc_handler = proc_dointvec |
36 | }, | 34 | }, |
37 | { | 35 | { |
38 | .ctl_name = NET_CORE_WMEM_DEFAULT, | ||
39 | .procname = "wmem_default", | 36 | .procname = "wmem_default", |
40 | .data = &sysctl_wmem_default, | 37 | .data = &sysctl_wmem_default, |
41 | .maxlen = sizeof(int), | 38 | .maxlen = sizeof(int), |
@@ -43,7 +40,6 @@ static struct ctl_table net_core_table[] = { | |||
43 | .proc_handler = proc_dointvec | 40 | .proc_handler = proc_dointvec |
44 | }, | 41 | }, |
45 | { | 42 | { |
46 | .ctl_name = NET_CORE_RMEM_DEFAULT, | ||
47 | .procname = "rmem_default", | 43 | .procname = "rmem_default", |
48 | .data = &sysctl_rmem_default, | 44 | .data = &sysctl_rmem_default, |
49 | .maxlen = sizeof(int), | 45 | .maxlen = sizeof(int), |
@@ -51,7 +47,6 @@ static struct ctl_table net_core_table[] = { | |||
51 | .proc_handler = proc_dointvec | 47 | .proc_handler = proc_dointvec |
52 | }, | 48 | }, |
53 | { | 49 | { |
54 | .ctl_name = NET_CORE_DEV_WEIGHT, | ||
55 | .procname = "dev_weight", | 50 | .procname = "dev_weight", |
56 | .data = &weight_p, | 51 | .data = &weight_p, |
57 | .maxlen = sizeof(int), | 52 | .maxlen = sizeof(int), |
@@ -59,7 +54,6 @@ static struct ctl_table net_core_table[] = { | |||
59 | .proc_handler = proc_dointvec | 54 | .proc_handler = proc_dointvec |
60 | }, | 55 | }, |
61 | { | 56 | { |
62 | .ctl_name = NET_CORE_MAX_BACKLOG, | ||
63 | .procname = "netdev_max_backlog", | 57 | .procname = "netdev_max_backlog", |
64 | .data = &netdev_max_backlog, | 58 | .data = &netdev_max_backlog, |
65 | .maxlen = sizeof(int), | 59 | .maxlen = sizeof(int), |
@@ -67,16 +61,13 @@ static struct ctl_table net_core_table[] = { | |||
67 | .proc_handler = proc_dointvec | 61 | .proc_handler = proc_dointvec |
68 | }, | 62 | }, |
69 | { | 63 | { |
70 | .ctl_name = NET_CORE_MSG_COST, | ||
71 | .procname = "message_cost", | 64 | .procname = "message_cost", |
72 | .data = &net_ratelimit_state.interval, | 65 | .data = &net_ratelimit_state.interval, |
73 | .maxlen = sizeof(int), | 66 | .maxlen = sizeof(int), |
74 | .mode = 0644, | 67 | .mode = 0644, |
75 | .proc_handler = proc_dointvec_jiffies, | 68 | .proc_handler = proc_dointvec_jiffies, |
76 | .strategy = sysctl_jiffies, | ||
77 | }, | 69 | }, |
78 | { | 70 | { |
79 | .ctl_name = NET_CORE_MSG_BURST, | ||
80 | .procname = "message_burst", | 71 | .procname = "message_burst", |
81 | .data = &net_ratelimit_state.burst, | 72 | .data = &net_ratelimit_state.burst, |
82 | .maxlen = sizeof(int), | 73 | .maxlen = sizeof(int), |
@@ -84,7 +75,6 @@ static struct ctl_table net_core_table[] = { | |||
84 | .proc_handler = proc_dointvec, | 75 | .proc_handler = proc_dointvec, |
85 | }, | 76 | }, |
86 | { | 77 | { |
87 | .ctl_name = NET_CORE_OPTMEM_MAX, | ||
88 | .procname = "optmem_max", | 78 | .procname = "optmem_max", |
89 | .data = &sysctl_optmem_max, | 79 | .data = &sysctl_optmem_max, |
90 | .maxlen = sizeof(int), | 80 | .maxlen = sizeof(int), |
@@ -93,7 +83,6 @@ static struct ctl_table net_core_table[] = { | |||
93 | }, | 83 | }, |
94 | #endif /* CONFIG_NET */ | 84 | #endif /* CONFIG_NET */ |
95 | { | 85 | { |
96 | .ctl_name = NET_CORE_BUDGET, | ||
97 | .procname = "netdev_budget", | 86 | .procname = "netdev_budget", |
98 | .data = &netdev_budget, | 87 | .data = &netdev_budget, |
99 | .maxlen = sizeof(int), | 88 | .maxlen = sizeof(int), |
@@ -101,31 +90,29 @@ static struct ctl_table net_core_table[] = { | |||
101 | .proc_handler = proc_dointvec | 90 | .proc_handler = proc_dointvec |
102 | }, | 91 | }, |
103 | { | 92 | { |
104 | .ctl_name = NET_CORE_WARNINGS, | ||
105 | .procname = "warnings", | 93 | .procname = "warnings", |
106 | .data = &net_msg_warn, | 94 | .data = &net_msg_warn, |
107 | .maxlen = sizeof(int), | 95 | .maxlen = sizeof(int), |
108 | .mode = 0644, | 96 | .mode = 0644, |
109 | .proc_handler = proc_dointvec | 97 | .proc_handler = proc_dointvec |
110 | }, | 98 | }, |
111 | { .ctl_name = 0 } | 99 | { } |
112 | }; | 100 | }; |
113 | 101 | ||
114 | static struct ctl_table netns_core_table[] = { | 102 | static struct ctl_table netns_core_table[] = { |
115 | { | 103 | { |
116 | .ctl_name = NET_CORE_SOMAXCONN, | ||
117 | .procname = "somaxconn", | 104 | .procname = "somaxconn", |
118 | .data = &init_net.core.sysctl_somaxconn, | 105 | .data = &init_net.core.sysctl_somaxconn, |
119 | .maxlen = sizeof(int), | 106 | .maxlen = sizeof(int), |
120 | .mode = 0644, | 107 | .mode = 0644, |
121 | .proc_handler = proc_dointvec | 108 | .proc_handler = proc_dointvec |
122 | }, | 109 | }, |
123 | { .ctl_name = 0 } | 110 | { } |
124 | }; | 111 | }; |
125 | 112 | ||
126 | __net_initdata struct ctl_path net_core_path[] = { | 113 | __net_initdata struct ctl_path net_core_path[] = { |
127 | { .procname = "net", .ctl_name = CTL_NET, }, | 114 | { .procname = "net", }, |
128 | { .procname = "core", .ctl_name = NET_CORE, }, | 115 | { .procname = "core", }, |
129 | { }, | 116 | { }, |
130 | }; | 117 | }; |
131 | 118 | ||
diff --git a/net/dccp/sysctl.c b/net/dccp/sysctl.c index a5a1856234e7..563943822e58 100644 --- a/net/dccp/sysctl.c +++ b/net/dccp/sysctl.c | |||
@@ -93,13 +93,13 @@ static struct ctl_table dccp_default_table[] = { | |||
93 | .proc_handler = proc_dointvec_ms_jiffies, | 93 | .proc_handler = proc_dointvec_ms_jiffies, |
94 | }, | 94 | }, |
95 | 95 | ||
96 | { .ctl_name = 0, } | 96 | { } |
97 | }; | 97 | }; |
98 | 98 | ||
99 | static struct ctl_path dccp_path[] = { | 99 | static struct ctl_path dccp_path[] = { |
100 | { .procname = "net", .ctl_name = CTL_NET, }, | 100 | { .procname = "net", }, |
101 | { .procname = "dccp", .ctl_name = NET_DCCP, }, | 101 | { .procname = "dccp", }, |
102 | { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, }, | 102 | { .procname = "default", }, |
103 | { } | 103 | { } |
104 | }; | 104 | }; |
105 | 105 | ||
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 6e1f085db06a..1b1daeb151f2 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -89,7 +89,6 @@ static struct dn_dev_parms dn_dev_list[] = { | |||
89 | .t2 = 1, | 89 | .t2 = 1, |
90 | .t3 = 10, | 90 | .t3 = 10, |
91 | .name = "ethernet", | 91 | .name = "ethernet", |
92 | .ctl_name = NET_DECNET_CONF_ETHER, | ||
93 | .up = dn_eth_up, | 92 | .up = dn_eth_up, |
94 | .down = dn_eth_down, | 93 | .down = dn_eth_down, |
95 | .timer3 = dn_send_brd_hello, | 94 | .timer3 = dn_send_brd_hello, |
@@ -101,7 +100,6 @@ static struct dn_dev_parms dn_dev_list[] = { | |||
101 | .t2 = 1, | 100 | .t2 = 1, |
102 | .t3 = 10, | 101 | .t3 = 10, |
103 | .name = "ipgre", | 102 | .name = "ipgre", |
104 | .ctl_name = NET_DECNET_CONF_GRE, | ||
105 | .timer3 = dn_send_brd_hello, | 103 | .timer3 = dn_send_brd_hello, |
106 | }, | 104 | }, |
107 | #if 0 | 105 | #if 0 |
@@ -112,7 +110,6 @@ static struct dn_dev_parms dn_dev_list[] = { | |||
112 | .t2 = 1, | 110 | .t2 = 1, |
113 | .t3 = 120, | 111 | .t3 = 120, |
114 | .name = "x25", | 112 | .name = "x25", |
115 | .ctl_name = NET_DECNET_CONF_X25, | ||
116 | .timer3 = dn_send_ptp_hello, | 113 | .timer3 = dn_send_ptp_hello, |
117 | }, | 114 | }, |
118 | #endif | 115 | #endif |
@@ -124,7 +121,6 @@ static struct dn_dev_parms dn_dev_list[] = { | |||
124 | .t2 = 1, | 121 | .t2 = 1, |
125 | .t3 = 10, | 122 | .t3 = 10, |
126 | .name = "ppp", | 123 | .name = "ppp", |
127 | .ctl_name = NET_DECNET_CONF_PPP, | ||
128 | .timer3 = dn_send_brd_hello, | 124 | .timer3 = dn_send_brd_hello, |
129 | }, | 125 | }, |
130 | #endif | 126 | #endif |
@@ -135,7 +131,6 @@ static struct dn_dev_parms dn_dev_list[] = { | |||
135 | .t2 = 1, | 131 | .t2 = 1, |
136 | .t3 = 120, | 132 | .t3 = 120, |
137 | .name = "ddcmp", | 133 | .name = "ddcmp", |
138 | .ctl_name = NET_DECNET_CONF_DDCMP, | ||
139 | .timer3 = dn_send_ptp_hello, | 134 | .timer3 = dn_send_ptp_hello, |
140 | }, | 135 | }, |
141 | { | 136 | { |
@@ -145,7 +140,6 @@ static struct dn_dev_parms dn_dev_list[] = { | |||
145 | .t2 = 1, | 140 | .t2 = 1, |
146 | .t3 = 10, | 141 | .t3 = 10, |
147 | .name = "loopback", | 142 | .name = "loopback", |
148 | .ctl_name = NET_DECNET_CONF_LOOPBACK, | ||
149 | .timer3 = dn_send_brd_hello, | 143 | .timer3 = dn_send_brd_hello, |
150 | } | 144 | } |
151 | }; | 145 | }; |
@@ -166,10 +160,6 @@ static int max_priority[] = { 127 }; /* From DECnet spec */ | |||
166 | 160 | ||
167 | static int dn_forwarding_proc(ctl_table *, int, | 161 | static int dn_forwarding_proc(ctl_table *, int, |
168 | void __user *, size_t *, loff_t *); | 162 | void __user *, size_t *, loff_t *); |
169 | static int dn_forwarding_sysctl(ctl_table *table, | ||
170 | void __user *oldval, size_t __user *oldlenp, | ||
171 | void __user *newval, size_t newlen); | ||
172 | |||
173 | static struct dn_dev_sysctl_table { | 163 | static struct dn_dev_sysctl_table { |
174 | struct ctl_table_header *sysctl_header; | 164 | struct ctl_table_header *sysctl_header; |
175 | ctl_table dn_dev_vars[5]; | 165 | ctl_table dn_dev_vars[5]; |
@@ -177,44 +167,36 @@ static struct dn_dev_sysctl_table { | |||
177 | NULL, | 167 | NULL, |
178 | { | 168 | { |
179 | { | 169 | { |
180 | .ctl_name = NET_DECNET_CONF_DEV_FORWARDING, | ||
181 | .procname = "forwarding", | 170 | .procname = "forwarding", |
182 | .data = (void *)DN_DEV_PARMS_OFFSET(forwarding), | 171 | .data = (void *)DN_DEV_PARMS_OFFSET(forwarding), |
183 | .maxlen = sizeof(int), | 172 | .maxlen = sizeof(int), |
184 | .mode = 0644, | 173 | .mode = 0644, |
185 | .proc_handler = dn_forwarding_proc, | 174 | .proc_handler = dn_forwarding_proc, |
186 | .strategy = dn_forwarding_sysctl, | ||
187 | }, | 175 | }, |
188 | { | 176 | { |
189 | .ctl_name = NET_DECNET_CONF_DEV_PRIORITY, | ||
190 | .procname = "priority", | 177 | .procname = "priority", |
191 | .data = (void *)DN_DEV_PARMS_OFFSET(priority), | 178 | .data = (void *)DN_DEV_PARMS_OFFSET(priority), |
192 | .maxlen = sizeof(int), | 179 | .maxlen = sizeof(int), |
193 | .mode = 0644, | 180 | .mode = 0644, |
194 | .proc_handler = proc_dointvec_minmax, | 181 | .proc_handler = proc_dointvec_minmax, |
195 | .strategy = sysctl_intvec, | ||
196 | .extra1 = &min_priority, | 182 | .extra1 = &min_priority, |
197 | .extra2 = &max_priority | 183 | .extra2 = &max_priority |
198 | }, | 184 | }, |
199 | { | 185 | { |
200 | .ctl_name = NET_DECNET_CONF_DEV_T2, | ||
201 | .procname = "t2", | 186 | .procname = "t2", |
202 | .data = (void *)DN_DEV_PARMS_OFFSET(t2), | 187 | .data = (void *)DN_DEV_PARMS_OFFSET(t2), |
203 | .maxlen = sizeof(int), | 188 | .maxlen = sizeof(int), |
204 | .mode = 0644, | 189 | .mode = 0644, |
205 | .proc_handler = proc_dointvec_minmax, | 190 | .proc_handler = proc_dointvec_minmax, |
206 | .strategy = sysctl_intvec, | ||
207 | .extra1 = &min_t2, | 191 | .extra1 = &min_t2, |
208 | .extra2 = &max_t2 | 192 | .extra2 = &max_t2 |
209 | }, | 193 | }, |
210 | { | 194 | { |
211 | .ctl_name = NET_DECNET_CONF_DEV_T3, | ||
212 | .procname = "t3", | 195 | .procname = "t3", |
213 | .data = (void *)DN_DEV_PARMS_OFFSET(t3), | 196 | .data = (void *)DN_DEV_PARMS_OFFSET(t3), |
214 | .maxlen = sizeof(int), | 197 | .maxlen = sizeof(int), |
215 | .mode = 0644, | 198 | .mode = 0644, |
216 | .proc_handler = proc_dointvec_minmax, | 199 | .proc_handler = proc_dointvec_minmax, |
217 | .strategy = sysctl_intvec, | ||
218 | .extra1 = &min_t3, | 200 | .extra1 = &min_t3, |
219 | .extra2 = &max_t3 | 201 | .extra2 = &max_t3 |
220 | }, | 202 | }, |
@@ -230,9 +212,9 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms * | |||
230 | #define DN_CTL_PATH_DEV 3 | 212 | #define DN_CTL_PATH_DEV 3 |
231 | 213 | ||
232 | struct ctl_path dn_ctl_path[] = { | 214 | struct ctl_path dn_ctl_path[] = { |
233 | { .procname = "net", .ctl_name = CTL_NET, }, | 215 | { .procname = "net", }, |
234 | { .procname = "decnet", .ctl_name = NET_DECNET, }, | 216 | { .procname = "decnet", }, |
235 | { .procname = "conf", .ctl_name = NET_DECNET_CONF, }, | 217 | { .procname = "conf", }, |
236 | { /* to be set */ }, | 218 | { /* to be set */ }, |
237 | { }, | 219 | { }, |
238 | }; | 220 | }; |
@@ -248,10 +230,8 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms * | |||
248 | 230 | ||
249 | if (dev) { | 231 | if (dev) { |
250 | dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name; | 232 | dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name; |
251 | dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = dev->ifindex; | ||
252 | } else { | 233 | } else { |
253 | dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name; | 234 | dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name; |
254 | dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = parms->ctl_name; | ||
255 | } | 235 | } |
256 | 236 | ||
257 | t->dn_dev_vars[0].extra1 = (void *)dev; | 237 | t->dn_dev_vars[0].extra1 = (void *)dev; |
@@ -317,44 +297,6 @@ static int dn_forwarding_proc(ctl_table *table, int write, | |||
317 | #endif | 297 | #endif |
318 | } | 298 | } |
319 | 299 | ||
320 | static int dn_forwarding_sysctl(ctl_table *table, | ||
321 | void __user *oldval, size_t __user *oldlenp, | ||
322 | void __user *newval, size_t newlen) | ||
323 | { | ||
324 | #ifdef CONFIG_DECNET_ROUTER | ||
325 | struct net_device *dev = table->extra1; | ||
326 | struct dn_dev *dn_db; | ||
327 | int value; | ||
328 | |||
329 | if (table->extra1 == NULL) | ||
330 | return -EINVAL; | ||
331 | |||
332 | dn_db = dev->dn_ptr; | ||
333 | |||
334 | if (newval && newlen) { | ||
335 | if (newlen != sizeof(int)) | ||
336 | return -EINVAL; | ||
337 | |||
338 | if (get_user(value, (int __user *)newval)) | ||
339 | return -EFAULT; | ||
340 | if (value < 0) | ||
341 | return -EINVAL; | ||
342 | if (value > 2) | ||
343 | return -EINVAL; | ||
344 | |||
345 | if (dn_db->parms.down) | ||
346 | dn_db->parms.down(dev); | ||
347 | dn_db->parms.forwarding = value; | ||
348 | if (dn_db->parms.up) | ||
349 | dn_db->parms.up(dev); | ||
350 | } | ||
351 | |||
352 | return 0; | ||
353 | #else | ||
354 | return -EINVAL; | ||
355 | #endif | ||
356 | } | ||
357 | |||
358 | #else /* CONFIG_SYSCTL */ | 300 | #else /* CONFIG_SYSCTL */ |
359 | static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms) | 301 | static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms) |
360 | { | 302 | { |
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c index 2036568beea9..be3eb8e23288 100644 --- a/net/decnet/sysctl_net_decnet.c +++ b/net/decnet/sysctl_net_decnet.c | |||
@@ -131,39 +131,6 @@ static int parse_addr(__le16 *addr, char *str) | |||
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | 133 | ||
134 | |||
135 | static int dn_node_address_strategy(ctl_table *table, | ||
136 | void __user *oldval, size_t __user *oldlenp, | ||
137 | void __user *newval, size_t newlen) | ||
138 | { | ||
139 | size_t len; | ||
140 | __le16 addr; | ||
141 | |||
142 | if (oldval && oldlenp) { | ||
143 | if (get_user(len, oldlenp)) | ||
144 | return -EFAULT; | ||
145 | if (len) { | ||
146 | if (len != sizeof(unsigned short)) | ||
147 | return -EINVAL; | ||
148 | if (put_user(decnet_address, (__le16 __user *)oldval)) | ||
149 | return -EFAULT; | ||
150 | } | ||
151 | } | ||
152 | if (newval && newlen) { | ||
153 | if (newlen != sizeof(unsigned short)) | ||
154 | return -EINVAL; | ||
155 | if (get_user(addr, (__le16 __user *)newval)) | ||
156 | return -EFAULT; | ||
157 | |||
158 | dn_dev_devices_off(); | ||
159 | |||
160 | decnet_address = addr; | ||
161 | |||
162 | dn_dev_devices_on(); | ||
163 | } | ||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static int dn_node_address_handler(ctl_table *table, int write, | 134 | static int dn_node_address_handler(ctl_table *table, int write, |
168 | void __user *buffer, | 135 | void __user *buffer, |
169 | size_t *lenp, loff_t *ppos) | 136 | size_t *lenp, loff_t *ppos) |
@@ -215,64 +182,6 @@ static int dn_node_address_handler(ctl_table *table, int write, | |||
215 | return 0; | 182 | return 0; |
216 | } | 183 | } |
217 | 184 | ||
218 | |||
219 | static int dn_def_dev_strategy(ctl_table *table, | ||
220 | void __user *oldval, size_t __user *oldlenp, | ||
221 | void __user *newval, size_t newlen) | ||
222 | { | ||
223 | size_t len; | ||
224 | struct net_device *dev; | ||
225 | char devname[17]; | ||
226 | size_t namel; | ||
227 | int rv = 0; | ||
228 | |||
229 | devname[0] = 0; | ||
230 | |||
231 | if (oldval && oldlenp) { | ||
232 | if (get_user(len, oldlenp)) | ||
233 | return -EFAULT; | ||
234 | if (len) { | ||
235 | dev = dn_dev_get_default(); | ||
236 | if (dev) { | ||
237 | strcpy(devname, dev->name); | ||
238 | dev_put(dev); | ||
239 | } | ||
240 | |||
241 | namel = strlen(devname) + 1; | ||
242 | if (len > namel) len = namel; | ||
243 | |||
244 | if (copy_to_user(oldval, devname, len)) | ||
245 | return -EFAULT; | ||
246 | |||
247 | if (put_user(len, oldlenp)) | ||
248 | return -EFAULT; | ||
249 | } | ||
250 | } | ||
251 | |||
252 | if (newval && newlen) { | ||
253 | if (newlen > 16) | ||
254 | return -E2BIG; | ||
255 | |||
256 | if (copy_from_user(devname, newval, newlen)) | ||
257 | return -EFAULT; | ||
258 | |||
259 | devname[newlen] = 0; | ||
260 | |||
261 | dev = dev_get_by_name(&init_net, devname); | ||
262 | if (dev == NULL) | ||
263 | return -ENODEV; | ||
264 | |||
265 | rv = -ENODEV; | ||
266 | if (dev->dn_ptr != NULL) | ||
267 | rv = dn_dev_set_default(dev, 1); | ||
268 | if (rv) | ||
269 | dev_put(dev); | ||
270 | } | ||
271 | |||
272 | return rv; | ||
273 | } | ||
274 | |||
275 | |||
276 | static int dn_def_dev_handler(ctl_table *table, int write, | 185 | static int dn_def_dev_handler(ctl_table *table, int write, |
277 | void __user *buffer, | 186 | void __user *buffer, |
278 | size_t *lenp, loff_t *ppos) | 187 | size_t *lenp, loff_t *ppos) |
@@ -338,138 +247,112 @@ static int dn_def_dev_handler(ctl_table *table, int write, | |||
338 | 247 | ||
339 | static ctl_table dn_table[] = { | 248 | static ctl_table dn_table[] = { |
340 | { | 249 | { |
341 | .ctl_name = NET_DECNET_NODE_ADDRESS, | ||
342 | .procname = "node_address", | 250 | .procname = "node_address", |
343 | .maxlen = 7, | 251 | .maxlen = 7, |
344 | .mode = 0644, | 252 | .mode = 0644, |
345 | .proc_handler = dn_node_address_handler, | 253 | .proc_handler = dn_node_address_handler, |
346 | .strategy = dn_node_address_strategy, | ||
347 | }, | 254 | }, |
348 | { | 255 | { |
349 | .ctl_name = NET_DECNET_NODE_NAME, | ||
350 | .procname = "node_name", | 256 | .procname = "node_name", |
351 | .data = node_name, | 257 | .data = node_name, |
352 | .maxlen = 7, | 258 | .maxlen = 7, |
353 | .mode = 0644, | 259 | .mode = 0644, |
354 | .proc_handler = proc_dostring, | 260 | .proc_handler = proc_dostring, |
355 | .strategy = sysctl_string, | ||
356 | }, | 261 | }, |
357 | { | 262 | { |
358 | .ctl_name = NET_DECNET_DEFAULT_DEVICE, | ||
359 | .procname = "default_device", | 263 | .procname = "default_device", |
360 | .maxlen = 16, | 264 | .maxlen = 16, |
361 | .mode = 0644, | 265 | .mode = 0644, |
362 | .proc_handler = dn_def_dev_handler, | 266 | .proc_handler = dn_def_dev_handler, |
363 | .strategy = dn_def_dev_strategy, | ||
364 | }, | 267 | }, |
365 | { | 268 | { |
366 | .ctl_name = NET_DECNET_TIME_WAIT, | ||
367 | .procname = "time_wait", | 269 | .procname = "time_wait", |
368 | .data = &decnet_time_wait, | 270 | .data = &decnet_time_wait, |
369 | .maxlen = sizeof(int), | 271 | .maxlen = sizeof(int), |
370 | .mode = 0644, | 272 | .mode = 0644, |
371 | .proc_handler = proc_dointvec_minmax, | 273 | .proc_handler = proc_dointvec_minmax, |
372 | .strategy = sysctl_intvec, | ||
373 | .extra1 = &min_decnet_time_wait, | 274 | .extra1 = &min_decnet_time_wait, |
374 | .extra2 = &max_decnet_time_wait | 275 | .extra2 = &max_decnet_time_wait |
375 | }, | 276 | }, |
376 | { | 277 | { |
377 | .ctl_name = NET_DECNET_DN_COUNT, | ||
378 | .procname = "dn_count", | 278 | .procname = "dn_count", |
379 | .data = &decnet_dn_count, | 279 | .data = &decnet_dn_count, |
380 | .maxlen = sizeof(int), | 280 | .maxlen = sizeof(int), |
381 | .mode = 0644, | 281 | .mode = 0644, |
382 | .proc_handler = proc_dointvec_minmax, | 282 | .proc_handler = proc_dointvec_minmax, |
383 | .strategy = sysctl_intvec, | ||
384 | .extra1 = &min_state_count, | 283 | .extra1 = &min_state_count, |
385 | .extra2 = &max_state_count | 284 | .extra2 = &max_state_count |
386 | }, | 285 | }, |
387 | { | 286 | { |
388 | .ctl_name = NET_DECNET_DI_COUNT, | ||
389 | .procname = "di_count", | 287 | .procname = "di_count", |
390 | .data = &decnet_di_count, | 288 | .data = &decnet_di_count, |
391 | .maxlen = sizeof(int), | 289 | .maxlen = sizeof(int), |
392 | .mode = 0644, | 290 | .mode = 0644, |
393 | .proc_handler = proc_dointvec_minmax, | 291 | .proc_handler = proc_dointvec_minmax, |
394 | .strategy = sysctl_intvec, | ||
395 | .extra1 = &min_state_count, | 292 | .extra1 = &min_state_count, |
396 | .extra2 = &max_state_count | 293 | .extra2 = &max_state_count |
397 | }, | 294 | }, |
398 | { | 295 | { |
399 | .ctl_name = NET_DECNET_DR_COUNT, | ||
400 | .procname = "dr_count", | 296 | .procname = "dr_count", |
401 | .data = &decnet_dr_count, | 297 | .data = &decnet_dr_count, |
402 | .maxlen = sizeof(int), | 298 | .maxlen = sizeof(int), |
403 | .mode = 0644, | 299 | .mode = 0644, |
404 | .proc_handler = proc_dointvec_minmax, | 300 | .proc_handler = proc_dointvec_minmax, |
405 | .strategy = sysctl_intvec, | ||
406 | .extra1 = &min_state_count, | 301 | .extra1 = &min_state_count, |
407 | .extra2 = &max_state_count | 302 | .extra2 = &max_state_count |
408 | }, | 303 | }, |
409 | { | 304 | { |
410 | .ctl_name = NET_DECNET_DST_GC_INTERVAL, | ||
411 | .procname = "dst_gc_interval", | 305 | .procname = "dst_gc_interval", |
412 | .data = &decnet_dst_gc_interval, | 306 | .data = &decnet_dst_gc_interval, |
413 | .maxlen = sizeof(int), | 307 | .maxlen = sizeof(int), |
414 | .mode = 0644, | 308 | .mode = 0644, |
415 | .proc_handler = proc_dointvec_minmax, | 309 | .proc_handler = proc_dointvec_minmax, |
416 | .strategy = sysctl_intvec, | ||
417 | .extra1 = &min_decnet_dst_gc_interval, | 310 | .extra1 = &min_decnet_dst_gc_interval, |
418 | .extra2 = &max_decnet_dst_gc_interval | 311 | .extra2 = &max_decnet_dst_gc_interval |
419 | }, | 312 | }, |
420 | { | 313 | { |
421 | .ctl_name = NET_DECNET_NO_FC_MAX_CWND, | ||
422 | .procname = "no_fc_max_cwnd", | 314 | .procname = "no_fc_max_cwnd", |
423 | .data = &decnet_no_fc_max_cwnd, | 315 | .data = &decnet_no_fc_max_cwnd, |
424 | .maxlen = sizeof(int), | 316 | .maxlen = sizeof(int), |
425 | .mode = 0644, | 317 | .mode = 0644, |
426 | .proc_handler = proc_dointvec_minmax, | 318 | .proc_handler = proc_dointvec_minmax, |
427 | .strategy = sysctl_intvec, | ||
428 | .extra1 = &min_decnet_no_fc_max_cwnd, | 319 | .extra1 = &min_decnet_no_fc_max_cwnd, |
429 | .extra2 = &max_decnet_no_fc_max_cwnd | 320 | .extra2 = &max_decnet_no_fc_max_cwnd |
430 | }, | 321 | }, |
431 | { | 322 | { |
432 | .ctl_name = NET_DECNET_MEM, | ||
433 | .procname = "decnet_mem", | 323 | .procname = "decnet_mem", |
434 | .data = &sysctl_decnet_mem, | 324 | .data = &sysctl_decnet_mem, |
435 | .maxlen = sizeof(sysctl_decnet_mem), | 325 | .maxlen = sizeof(sysctl_decnet_mem), |
436 | .mode = 0644, | 326 | .mode = 0644, |
437 | .proc_handler = proc_dointvec, | 327 | .proc_handler = proc_dointvec, |
438 | .strategy = sysctl_intvec, | ||
439 | }, | 328 | }, |
440 | { | 329 | { |
441 | .ctl_name = NET_DECNET_RMEM, | ||
442 | .procname = "decnet_rmem", | 330 | .procname = "decnet_rmem", |
443 | .data = &sysctl_decnet_rmem, | 331 | .data = &sysctl_decnet_rmem, |
444 | .maxlen = sizeof(sysctl_decnet_rmem), | 332 | .maxlen = sizeof(sysctl_decnet_rmem), |
445 | .mode = 0644, | 333 | .mode = 0644, |
446 | .proc_handler = proc_dointvec, | 334 | .proc_handler = proc_dointvec, |
447 | .strategy = sysctl_intvec, | ||
448 | }, | 335 | }, |
449 | { | 336 | { |
450 | .ctl_name = NET_DECNET_WMEM, | ||
451 | .procname = "decnet_wmem", | 337 | .procname = "decnet_wmem", |
452 | .data = &sysctl_decnet_wmem, | 338 | .data = &sysctl_decnet_wmem, |
453 | .maxlen = sizeof(sysctl_decnet_wmem), | 339 | .maxlen = sizeof(sysctl_decnet_wmem), |
454 | .mode = 0644, | 340 | .mode = 0644, |
455 | .proc_handler = proc_dointvec, | 341 | .proc_handler = proc_dointvec, |
456 | .strategy = sysctl_intvec, | ||
457 | }, | 342 | }, |
458 | { | 343 | { |
459 | .ctl_name = NET_DECNET_DEBUG_LEVEL, | ||
460 | .procname = "debug", | 344 | .procname = "debug", |
461 | .data = &decnet_debug_level, | 345 | .data = &decnet_debug_level, |
462 | .maxlen = sizeof(int), | 346 | .maxlen = sizeof(int), |
463 | .mode = 0644, | 347 | .mode = 0644, |
464 | .proc_handler = proc_dointvec, | 348 | .proc_handler = proc_dointvec, |
465 | .strategy = sysctl_intvec, | ||
466 | }, | 349 | }, |
467 | {0} | 350 | { } |
468 | }; | 351 | }; |
469 | 352 | ||
470 | static struct ctl_path dn_path[] = { | 353 | static struct ctl_path dn_path[] = { |
471 | { .procname = "net", .ctl_name = CTL_NET, }, | 354 | { .procname = "net", }, |
472 | { .procname = "decnet", .ctl_name = NET_DECNET, }, | 355 | { .procname = "decnet", }, |
473 | { } | 356 | { } |
474 | }; | 357 | }; |
475 | 358 | ||
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 4e80f336c0cf..c95cd93acf29 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -1240,7 +1240,7 @@ void __init arp_init(void) | |||
1240 | arp_proc_init(); | 1240 | arp_proc_init(); |
1241 | #ifdef CONFIG_SYSCTL | 1241 | #ifdef CONFIG_SYSCTL |
1242 | neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, | 1242 | neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, |
1243 | NET_IPV4_NEIGH, "ipv4", NULL, NULL); | 1243 | NET_IPV4_NEIGH, "ipv4", NULL); |
1244 | #endif | 1244 | #endif |
1245 | register_netdevice_notifier(&arp_netdev_notifier); | 1245 | register_netdevice_notifier(&arp_netdev_notifier); |
1246 | } | 1246 | } |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 5df2f6a0b0f0..e049da8311b5 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1293,58 +1293,6 @@ static int devinet_conf_proc(ctl_table *ctl, int write, | |||
1293 | return ret; | 1293 | return ret; |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | static int devinet_conf_sysctl(ctl_table *table, | ||
1297 | void __user *oldval, size_t __user *oldlenp, | ||
1298 | void __user *newval, size_t newlen) | ||
1299 | { | ||
1300 | struct ipv4_devconf *cnf; | ||
1301 | struct net *net; | ||
1302 | int *valp = table->data; | ||
1303 | int new; | ||
1304 | int i; | ||
1305 | |||
1306 | if (!newval || !newlen) | ||
1307 | return 0; | ||
1308 | |||
1309 | if (newlen != sizeof(int)) | ||
1310 | return -EINVAL; | ||
1311 | |||
1312 | if (get_user(new, (int __user *)newval)) | ||
1313 | return -EFAULT; | ||
1314 | |||
1315 | if (new == *valp) | ||
1316 | return 0; | ||
1317 | |||
1318 | if (oldval && oldlenp) { | ||
1319 | size_t len; | ||
1320 | |||
1321 | if (get_user(len, oldlenp)) | ||
1322 | return -EFAULT; | ||
1323 | |||
1324 | if (len) { | ||
1325 | if (len > table->maxlen) | ||
1326 | len = table->maxlen; | ||
1327 | if (copy_to_user(oldval, valp, len)) | ||
1328 | return -EFAULT; | ||
1329 | if (put_user(len, oldlenp)) | ||
1330 | return -EFAULT; | ||
1331 | } | ||
1332 | } | ||
1333 | |||
1334 | *valp = new; | ||
1335 | |||
1336 | cnf = table->extra1; | ||
1337 | net = table->extra2; | ||
1338 | i = (int *)table->data - cnf->data; | ||
1339 | |||
1340 | set_bit(i, cnf->state); | ||
1341 | |||
1342 | if (cnf == net->ipv4.devconf_dflt) | ||
1343 | devinet_copy_dflt_conf(net, i); | ||
1344 | |||
1345 | return 1; | ||
1346 | } | ||
1347 | |||
1348 | static int devinet_sysctl_forward(ctl_table *ctl, int write, | 1296 | static int devinet_sysctl_forward(ctl_table *ctl, int write, |
1349 | void __user *buffer, | 1297 | void __user *buffer, |
1350 | size_t *lenp, loff_t *ppos) | 1298 | size_t *lenp, loff_t *ppos) |
@@ -1390,47 +1338,28 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write, | |||
1390 | return ret; | 1338 | return ret; |
1391 | } | 1339 | } |
1392 | 1340 | ||
1393 | int ipv4_doint_and_flush_strategy(ctl_table *table, | 1341 | #define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc) \ |
1394 | void __user *oldval, size_t __user *oldlenp, | ||
1395 | void __user *newval, size_t newlen) | ||
1396 | { | ||
1397 | int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen); | ||
1398 | struct net *net = table->extra2; | ||
1399 | |||
1400 | if (ret == 1) | ||
1401 | rt_cache_flush(net, 0); | ||
1402 | |||
1403 | return ret; | ||
1404 | } | ||
1405 | |||
1406 | |||
1407 | #define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc, sysctl) \ | ||
1408 | { \ | 1342 | { \ |
1409 | .ctl_name = NET_IPV4_CONF_ ## attr, \ | ||
1410 | .procname = name, \ | 1343 | .procname = name, \ |
1411 | .data = ipv4_devconf.data + \ | 1344 | .data = ipv4_devconf.data + \ |
1412 | NET_IPV4_CONF_ ## attr - 1, \ | 1345 | NET_IPV4_CONF_ ## attr - 1, \ |
1413 | .maxlen = sizeof(int), \ | 1346 | .maxlen = sizeof(int), \ |
1414 | .mode = mval, \ | 1347 | .mode = mval, \ |
1415 | .proc_handler = proc, \ | 1348 | .proc_handler = proc, \ |
1416 | .strategy = sysctl, \ | ||
1417 | .extra1 = &ipv4_devconf, \ | 1349 | .extra1 = &ipv4_devconf, \ |
1418 | } | 1350 | } |
1419 | 1351 | ||
1420 | #define DEVINET_SYSCTL_RW_ENTRY(attr, name) \ | 1352 | #define DEVINET_SYSCTL_RW_ENTRY(attr, name) \ |
1421 | DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc, \ | 1353 | DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc) |
1422 | devinet_conf_sysctl) | ||
1423 | 1354 | ||
1424 | #define DEVINET_SYSCTL_RO_ENTRY(attr, name) \ | 1355 | #define DEVINET_SYSCTL_RO_ENTRY(attr, name) \ |
1425 | DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc, \ | 1356 | DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc) |
1426 | devinet_conf_sysctl) | ||
1427 | 1357 | ||
1428 | #define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc, sysctl) \ | 1358 | #define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc) \ |
1429 | DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc, sysctl) | 1359 | DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc) |
1430 | 1360 | ||
1431 | #define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \ | 1361 | #define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \ |
1432 | DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush, \ | 1362 | DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush) |
1433 | ipv4_doint_and_flush_strategy) | ||
1434 | 1363 | ||
1435 | static struct devinet_sysctl_table { | 1364 | static struct devinet_sysctl_table { |
1436 | struct ctl_table_header *sysctl_header; | 1365 | struct ctl_table_header *sysctl_header; |
@@ -1439,8 +1368,7 @@ static struct devinet_sysctl_table { | |||
1439 | } devinet_sysctl = { | 1368 | } devinet_sysctl = { |
1440 | .devinet_vars = { | 1369 | .devinet_vars = { |
1441 | DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding", | 1370 | DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding", |
1442 | devinet_sysctl_forward, | 1371 | devinet_sysctl_forward), |
1443 | devinet_conf_sysctl), | ||
1444 | DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"), | 1372 | DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"), |
1445 | 1373 | ||
1446 | DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"), | 1374 | DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"), |
@@ -1471,7 +1399,7 @@ static struct devinet_sysctl_table { | |||
1471 | }; | 1399 | }; |
1472 | 1400 | ||
1473 | static int __devinet_sysctl_register(struct net *net, char *dev_name, | 1401 | static int __devinet_sysctl_register(struct net *net, char *dev_name, |
1474 | int ctl_name, struct ipv4_devconf *p) | 1402 | struct ipv4_devconf *p) |
1475 | { | 1403 | { |
1476 | int i; | 1404 | int i; |
1477 | struct devinet_sysctl_table *t; | 1405 | struct devinet_sysctl_table *t; |
@@ -1479,9 +1407,9 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name, | |||
1479 | #define DEVINET_CTL_PATH_DEV 3 | 1407 | #define DEVINET_CTL_PATH_DEV 3 |
1480 | 1408 | ||
1481 | struct ctl_path devinet_ctl_path[] = { | 1409 | struct ctl_path devinet_ctl_path[] = { |
1482 | { .procname = "net", .ctl_name = CTL_NET, }, | 1410 | { .procname = "net", }, |
1483 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 1411 | { .procname = "ipv4", }, |
1484 | { .procname = "conf", .ctl_name = NET_IPV4_CONF, }, | 1412 | { .procname = "conf", }, |
1485 | { /* to be set */ }, | 1413 | { /* to be set */ }, |
1486 | { }, | 1414 | { }, |
1487 | }; | 1415 | }; |
@@ -1506,7 +1434,6 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name, | |||
1506 | goto free; | 1434 | goto free; |
1507 | 1435 | ||
1508 | devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name; | 1436 | devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name; |
1509 | devinet_ctl_path[DEVINET_CTL_PATH_DEV].ctl_name = ctl_name; | ||
1510 | 1437 | ||
1511 | t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path, | 1438 | t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path, |
1512 | t->devinet_vars); | 1439 | t->devinet_vars); |
@@ -1540,9 +1467,9 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf) | |||
1540 | static void devinet_sysctl_register(struct in_device *idev) | 1467 | static void devinet_sysctl_register(struct in_device *idev) |
1541 | { | 1468 | { |
1542 | neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, | 1469 | neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, |
1543 | NET_IPV4_NEIGH, "ipv4", NULL, NULL); | 1470 | NET_IPV4_NEIGH, "ipv4", NULL); |
1544 | __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, | 1471 | __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, |
1545 | idev->dev->ifindex, &idev->cnf); | 1472 | &idev->cnf); |
1546 | } | 1473 | } |
1547 | 1474 | ||
1548 | static void devinet_sysctl_unregister(struct in_device *idev) | 1475 | static void devinet_sysctl_unregister(struct in_device *idev) |
@@ -1553,14 +1480,12 @@ static void devinet_sysctl_unregister(struct in_device *idev) | |||
1553 | 1480 | ||
1554 | static struct ctl_table ctl_forward_entry[] = { | 1481 | static struct ctl_table ctl_forward_entry[] = { |
1555 | { | 1482 | { |
1556 | .ctl_name = NET_IPV4_FORWARD, | ||
1557 | .procname = "ip_forward", | 1483 | .procname = "ip_forward", |
1558 | .data = &ipv4_devconf.data[ | 1484 | .data = &ipv4_devconf.data[ |
1559 | NET_IPV4_CONF_FORWARDING - 1], | 1485 | NET_IPV4_CONF_FORWARDING - 1], |
1560 | .maxlen = sizeof(int), | 1486 | .maxlen = sizeof(int), |
1561 | .mode = 0644, | 1487 | .mode = 0644, |
1562 | .proc_handler = devinet_sysctl_forward, | 1488 | .proc_handler = devinet_sysctl_forward, |
1563 | .strategy = devinet_conf_sysctl, | ||
1564 | .extra1 = &ipv4_devconf, | 1489 | .extra1 = &ipv4_devconf, |
1565 | .extra2 = &init_net, | 1490 | .extra2 = &init_net, |
1566 | }, | 1491 | }, |
@@ -1568,8 +1493,8 @@ static struct ctl_table ctl_forward_entry[] = { | |||
1568 | }; | 1493 | }; |
1569 | 1494 | ||
1570 | static __net_initdata struct ctl_path net_ipv4_path[] = { | 1495 | static __net_initdata struct ctl_path net_ipv4_path[] = { |
1571 | { .procname = "net", .ctl_name = CTL_NET, }, | 1496 | { .procname = "net", }, |
1572 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 1497 | { .procname = "ipv4", }, |
1573 | { }, | 1498 | { }, |
1574 | }; | 1499 | }; |
1575 | #endif | 1500 | #endif |
@@ -1608,13 +1533,11 @@ static __net_init int devinet_init_net(struct net *net) | |||
1608 | } | 1533 | } |
1609 | 1534 | ||
1610 | #ifdef CONFIG_SYSCTL | 1535 | #ifdef CONFIG_SYSCTL |
1611 | err = __devinet_sysctl_register(net, "all", | 1536 | err = __devinet_sysctl_register(net, "all", all); |
1612 | NET_PROTO_CONF_ALL, all); | ||
1613 | if (err < 0) | 1537 | if (err < 0) |
1614 | goto err_reg_all; | 1538 | goto err_reg_all; |
1615 | 1539 | ||
1616 | err = __devinet_sysctl_register(net, "default", | 1540 | err = __devinet_sysctl_register(net, "default", dflt); |
1617 | NET_PROTO_CONF_DEFAULT, dflt); | ||
1618 | if (err < 0) | 1541 | if (err < 0) |
1619 | goto err_reg_dflt; | 1542 | goto err_reg_dflt; |
1620 | 1543 | ||
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index d3fe10be7219..301a389fa7fa 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -603,7 +603,6 @@ static int zero; | |||
603 | 603 | ||
604 | static struct ctl_table ip4_frags_ns_ctl_table[] = { | 604 | static struct ctl_table ip4_frags_ns_ctl_table[] = { |
605 | { | 605 | { |
606 | .ctl_name = NET_IPV4_IPFRAG_HIGH_THRESH, | ||
607 | .procname = "ipfrag_high_thresh", | 606 | .procname = "ipfrag_high_thresh", |
608 | .data = &init_net.ipv4.frags.high_thresh, | 607 | .data = &init_net.ipv4.frags.high_thresh, |
609 | .maxlen = sizeof(int), | 608 | .maxlen = sizeof(int), |
@@ -611,7 +610,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = { | |||
611 | .proc_handler = proc_dointvec | 610 | .proc_handler = proc_dointvec |
612 | }, | 611 | }, |
613 | { | 612 | { |
614 | .ctl_name = NET_IPV4_IPFRAG_LOW_THRESH, | ||
615 | .procname = "ipfrag_low_thresh", | 613 | .procname = "ipfrag_low_thresh", |
616 | .data = &init_net.ipv4.frags.low_thresh, | 614 | .data = &init_net.ipv4.frags.low_thresh, |
617 | .maxlen = sizeof(int), | 615 | .maxlen = sizeof(int), |
@@ -619,26 +617,22 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = { | |||
619 | .proc_handler = proc_dointvec | 617 | .proc_handler = proc_dointvec |
620 | }, | 618 | }, |
621 | { | 619 | { |
622 | .ctl_name = NET_IPV4_IPFRAG_TIME, | ||
623 | .procname = "ipfrag_time", | 620 | .procname = "ipfrag_time", |
624 | .data = &init_net.ipv4.frags.timeout, | 621 | .data = &init_net.ipv4.frags.timeout, |
625 | .maxlen = sizeof(int), | 622 | .maxlen = sizeof(int), |
626 | .mode = 0644, | 623 | .mode = 0644, |
627 | .proc_handler = proc_dointvec_jiffies, | 624 | .proc_handler = proc_dointvec_jiffies, |
628 | .strategy = sysctl_jiffies | ||
629 | }, | 625 | }, |
630 | { } | 626 | { } |
631 | }; | 627 | }; |
632 | 628 | ||
633 | static struct ctl_table ip4_frags_ctl_table[] = { | 629 | static struct ctl_table ip4_frags_ctl_table[] = { |
634 | { | 630 | { |
635 | .ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL, | ||
636 | .procname = "ipfrag_secret_interval", | 631 | .procname = "ipfrag_secret_interval", |
637 | .data = &ip4_frags.secret_interval, | 632 | .data = &ip4_frags.secret_interval, |
638 | .maxlen = sizeof(int), | 633 | .maxlen = sizeof(int), |
639 | .mode = 0644, | 634 | .mode = 0644, |
640 | .proc_handler = proc_dointvec_jiffies, | 635 | .proc_handler = proc_dointvec_jiffies, |
641 | .strategy = sysctl_jiffies | ||
642 | }, | 636 | }, |
643 | { | 637 | { |
644 | .procname = "ipfrag_max_dist", | 638 | .procname = "ipfrag_max_dist", |
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index 1725dc0ef688..db52c0cb0c11 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c | |||
@@ -248,9 +248,9 @@ module_exit(ipv4_netfilter_fini); | |||
248 | 248 | ||
249 | #ifdef CONFIG_SYSCTL | 249 | #ifdef CONFIG_SYSCTL |
250 | struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { | 250 | struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { |
251 | { .procname = "net", .ctl_name = CTL_NET, }, | 251 | { .procname = "net", }, |
252 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 252 | { .procname = "ipv4", }, |
253 | { .procname = "netfilter", .ctl_name = NET_IPV4_NETFILTER, }, | 253 | { .procname = "netfilter", }, |
254 | { } | 254 | { } |
255 | }; | 255 | }; |
256 | EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path); | 256 | EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path); |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index c156db215987..c9f90e8c5191 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -516,14 +516,13 @@ static struct ctl_table_header *ipq_sysctl_header; | |||
516 | 516 | ||
517 | static ctl_table ipq_table[] = { | 517 | static ctl_table ipq_table[] = { |
518 | { | 518 | { |
519 | .ctl_name = NET_IPQ_QMAX, | ||
520 | .procname = NET_IPQ_QMAX_NAME, | 519 | .procname = NET_IPQ_QMAX_NAME, |
521 | .data = &queue_maxlen, | 520 | .data = &queue_maxlen, |
522 | .maxlen = sizeof(queue_maxlen), | 521 | .maxlen = sizeof(queue_maxlen), |
523 | .mode = 0644, | 522 | .mode = 0644, |
524 | .proc_handler = proc_dointvec | 523 | .proc_handler = proc_dointvec |
525 | }, | 524 | }, |
526 | { .ctl_name = 0 } | 525 | { } |
527 | }; | 526 | }; |
528 | #endif | 527 | #endif |
529 | 528 | ||
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c index aa95bb82ee6c..092d68f916e6 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | |||
@@ -195,7 +195,6 @@ static int log_invalid_proto_max = 255; | |||
195 | 195 | ||
196 | static ctl_table ip_ct_sysctl_table[] = { | 196 | static ctl_table ip_ct_sysctl_table[] = { |
197 | { | 197 | { |
198 | .ctl_name = NET_IPV4_NF_CONNTRACK_MAX, | ||
199 | .procname = "ip_conntrack_max", | 198 | .procname = "ip_conntrack_max", |
200 | .data = &nf_conntrack_max, | 199 | .data = &nf_conntrack_max, |
201 | .maxlen = sizeof(int), | 200 | .maxlen = sizeof(int), |
@@ -203,7 +202,6 @@ static ctl_table ip_ct_sysctl_table[] = { | |||
203 | .proc_handler = proc_dointvec, | 202 | .proc_handler = proc_dointvec, |
204 | }, | 203 | }, |
205 | { | 204 | { |
206 | .ctl_name = NET_IPV4_NF_CONNTRACK_COUNT, | ||
207 | .procname = "ip_conntrack_count", | 205 | .procname = "ip_conntrack_count", |
208 | .data = &init_net.ct.count, | 206 | .data = &init_net.ct.count, |
209 | .maxlen = sizeof(int), | 207 | .maxlen = sizeof(int), |
@@ -211,7 +209,6 @@ static ctl_table ip_ct_sysctl_table[] = { | |||
211 | .proc_handler = proc_dointvec, | 209 | .proc_handler = proc_dointvec, |
212 | }, | 210 | }, |
213 | { | 211 | { |
214 | .ctl_name = NET_IPV4_NF_CONNTRACK_BUCKETS, | ||
215 | .procname = "ip_conntrack_buckets", | 212 | .procname = "ip_conntrack_buckets", |
216 | .data = &nf_conntrack_htable_size, | 213 | .data = &nf_conntrack_htable_size, |
217 | .maxlen = sizeof(unsigned int), | 214 | .maxlen = sizeof(unsigned int), |
@@ -219,7 +216,6 @@ static ctl_table ip_ct_sysctl_table[] = { | |||
219 | .proc_handler = proc_dointvec, | 216 | .proc_handler = proc_dointvec, |
220 | }, | 217 | }, |
221 | { | 218 | { |
222 | .ctl_name = NET_IPV4_NF_CONNTRACK_CHECKSUM, | ||
223 | .procname = "ip_conntrack_checksum", | 219 | .procname = "ip_conntrack_checksum", |
224 | .data = &init_net.ct.sysctl_checksum, | 220 | .data = &init_net.ct.sysctl_checksum, |
225 | .maxlen = sizeof(int), | 221 | .maxlen = sizeof(int), |
@@ -227,19 +223,15 @@ static ctl_table ip_ct_sysctl_table[] = { | |||
227 | .proc_handler = proc_dointvec, | 223 | .proc_handler = proc_dointvec, |
228 | }, | 224 | }, |
229 | { | 225 | { |
230 | .ctl_name = NET_IPV4_NF_CONNTRACK_LOG_INVALID, | ||
231 | .procname = "ip_conntrack_log_invalid", | 226 | .procname = "ip_conntrack_log_invalid", |
232 | .data = &init_net.ct.sysctl_log_invalid, | 227 | .data = &init_net.ct.sysctl_log_invalid, |
233 | .maxlen = sizeof(unsigned int), | 228 | .maxlen = sizeof(unsigned int), |
234 | .mode = 0644, | 229 | .mode = 0644, |
235 | .proc_handler = proc_dointvec_minmax, | 230 | .proc_handler = proc_dointvec_minmax, |
236 | .strategy = sysctl_intvec, | ||
237 | .extra1 = &log_invalid_proto_min, | 231 | .extra1 = &log_invalid_proto_min, |
238 | .extra2 = &log_invalid_proto_max, | 232 | .extra2 = &log_invalid_proto_max, |
239 | }, | 233 | }, |
240 | { | 234 | { } |
241 | .ctl_name = 0 | ||
242 | } | ||
243 | }; | 235 | }; |
244 | #endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */ | 236 | #endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */ |
245 | 237 | ||
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c index d71ba7677344..9072058778b8 100644 --- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c +++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c | |||
@@ -270,9 +270,7 @@ static struct ctl_table icmp_sysctl_table[] = { | |||
270 | .mode = 0644, | 270 | .mode = 0644, |
271 | .proc_handler = proc_dointvec_jiffies, | 271 | .proc_handler = proc_dointvec_jiffies, |
272 | }, | 272 | }, |
273 | { | 273 | { } |
274 | .ctl_name = 0 | ||
275 | } | ||
276 | }; | 274 | }; |
277 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | 275 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
278 | static struct ctl_table icmp_compat_sysctl_table[] = { | 276 | static struct ctl_table icmp_compat_sysctl_table[] = { |
@@ -283,9 +281,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = { | |||
283 | .mode = 0644, | 281 | .mode = 0644, |
284 | .proc_handler = proc_dointvec_jiffies, | 282 | .proc_handler = proc_dointvec_jiffies, |
285 | }, | 283 | }, |
286 | { | 284 | { } |
287 | .ctl_name = 0 | ||
288 | } | ||
289 | }; | 285 | }; |
290 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ | 286 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ |
291 | #endif /* CONFIG_SYSCTL */ | 287 | #endif /* CONFIG_SYSCTL */ |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 5b1050a5d874..0d9f584a3811 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -3056,23 +3056,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write, | |||
3056 | return -EINVAL; | 3056 | return -EINVAL; |
3057 | } | 3057 | } |
3058 | 3058 | ||
3059 | static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, | ||
3060 | void __user *oldval, | ||
3061 | size_t __user *oldlenp, | ||
3062 | void __user *newval, | ||
3063 | size_t newlen) | ||
3064 | { | ||
3065 | int delay; | ||
3066 | struct net *net; | ||
3067 | if (newlen != sizeof(int)) | ||
3068 | return -EINVAL; | ||
3069 | if (get_user(delay, (int __user *)newval)) | ||
3070 | return -EFAULT; | ||
3071 | net = (struct net *)table->extra1; | ||
3072 | rt_cache_flush(net, delay); | ||
3073 | return 0; | ||
3074 | } | ||
3075 | |||
3076 | static void rt_secret_reschedule(int old) | 3059 | static void rt_secret_reschedule(int old) |
3077 | { | 3060 | { |
3078 | struct net *net; | 3061 | struct net *net; |
@@ -3117,23 +3100,8 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write, | |||
3117 | return ret; | 3100 | return ret; |
3118 | } | 3101 | } |
3119 | 3102 | ||
3120 | static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table, | ||
3121 | void __user *oldval, | ||
3122 | size_t __user *oldlenp, | ||
3123 | void __user *newval, | ||
3124 | size_t newlen) | ||
3125 | { | ||
3126 | int old = ip_rt_secret_interval; | ||
3127 | int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen); | ||
3128 | |||
3129 | rt_secret_reschedule(old); | ||
3130 | |||
3131 | return ret; | ||
3132 | } | ||
3133 | |||
3134 | static ctl_table ipv4_route_table[] = { | 3103 | static ctl_table ipv4_route_table[] = { |
3135 | { | 3104 | { |
3136 | .ctl_name = NET_IPV4_ROUTE_GC_THRESH, | ||
3137 | .procname = "gc_thresh", | 3105 | .procname = "gc_thresh", |
3138 | .data = &ipv4_dst_ops.gc_thresh, | 3106 | .data = &ipv4_dst_ops.gc_thresh, |
3139 | .maxlen = sizeof(int), | 3107 | .maxlen = sizeof(int), |
@@ -3141,7 +3109,6 @@ static ctl_table ipv4_route_table[] = { | |||
3141 | .proc_handler = proc_dointvec, | 3109 | .proc_handler = proc_dointvec, |
3142 | }, | 3110 | }, |
3143 | { | 3111 | { |
3144 | .ctl_name = NET_IPV4_ROUTE_MAX_SIZE, | ||
3145 | .procname = "max_size", | 3112 | .procname = "max_size", |
3146 | .data = &ip_rt_max_size, | 3113 | .data = &ip_rt_max_size, |
3147 | .maxlen = sizeof(int), | 3114 | .maxlen = sizeof(int), |
@@ -3151,43 +3118,34 @@ static ctl_table ipv4_route_table[] = { | |||
3151 | { | 3118 | { |
3152 | /* Deprecated. Use gc_min_interval_ms */ | 3119 | /* Deprecated. Use gc_min_interval_ms */ |
3153 | 3120 | ||
3154 | .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL, | ||
3155 | .procname = "gc_min_interval", | 3121 | .procname = "gc_min_interval", |
3156 | .data = &ip_rt_gc_min_interval, | 3122 | .data = &ip_rt_gc_min_interval, |
3157 | .maxlen = sizeof(int), | 3123 | .maxlen = sizeof(int), |
3158 | .mode = 0644, | 3124 | .mode = 0644, |
3159 | .proc_handler = proc_dointvec_jiffies, | 3125 | .proc_handler = proc_dointvec_jiffies, |
3160 | .strategy = sysctl_jiffies, | ||
3161 | }, | 3126 | }, |
3162 | { | 3127 | { |
3163 | .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, | ||
3164 | .procname = "gc_min_interval_ms", | 3128 | .procname = "gc_min_interval_ms", |
3165 | .data = &ip_rt_gc_min_interval, | 3129 | .data = &ip_rt_gc_min_interval, |
3166 | .maxlen = sizeof(int), | 3130 | .maxlen = sizeof(int), |
3167 | .mode = 0644, | 3131 | .mode = 0644, |
3168 | .proc_handler = proc_dointvec_ms_jiffies, | 3132 | .proc_handler = proc_dointvec_ms_jiffies, |
3169 | .strategy = sysctl_ms_jiffies, | ||
3170 | }, | 3133 | }, |
3171 | { | 3134 | { |
3172 | .ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT, | ||
3173 | .procname = "gc_timeout", | 3135 | .procname = "gc_timeout", |
3174 | .data = &ip_rt_gc_timeout, | 3136 | .data = &ip_rt_gc_timeout, |
3175 | .maxlen = sizeof(int), | 3137 | .maxlen = sizeof(int), |
3176 | .mode = 0644, | 3138 | .mode = 0644, |
3177 | .proc_handler = proc_dointvec_jiffies, | 3139 | .proc_handler = proc_dointvec_jiffies, |
3178 | .strategy = sysctl_jiffies, | ||
3179 | }, | 3140 | }, |
3180 | { | 3141 | { |
3181 | .ctl_name = NET_IPV4_ROUTE_GC_INTERVAL, | ||
3182 | .procname = "gc_interval", | 3142 | .procname = "gc_interval", |
3183 | .data = &ip_rt_gc_interval, | 3143 | .data = &ip_rt_gc_interval, |
3184 | .maxlen = sizeof(int), | 3144 | .maxlen = sizeof(int), |
3185 | .mode = 0644, | 3145 | .mode = 0644, |
3186 | .proc_handler = proc_dointvec_jiffies, | 3146 | .proc_handler = proc_dointvec_jiffies, |
3187 | .strategy = sysctl_jiffies, | ||
3188 | }, | 3147 | }, |
3189 | { | 3148 | { |
3190 | .ctl_name = NET_IPV4_ROUTE_REDIRECT_LOAD, | ||
3191 | .procname = "redirect_load", | 3149 | .procname = "redirect_load", |
3192 | .data = &ip_rt_redirect_load, | 3150 | .data = &ip_rt_redirect_load, |
3193 | .maxlen = sizeof(int), | 3151 | .maxlen = sizeof(int), |
@@ -3195,7 +3153,6 @@ static ctl_table ipv4_route_table[] = { | |||
3195 | .proc_handler = proc_dointvec, | 3153 | .proc_handler = proc_dointvec, |
3196 | }, | 3154 | }, |
3197 | { | 3155 | { |
3198 | .ctl_name = NET_IPV4_ROUTE_REDIRECT_NUMBER, | ||
3199 | .procname = "redirect_number", | 3156 | .procname = "redirect_number", |
3200 | .data = &ip_rt_redirect_number, | 3157 | .data = &ip_rt_redirect_number, |
3201 | .maxlen = sizeof(int), | 3158 | .maxlen = sizeof(int), |
@@ -3203,7 +3160,6 @@ static ctl_table ipv4_route_table[] = { | |||
3203 | .proc_handler = proc_dointvec, | 3160 | .proc_handler = proc_dointvec, |
3204 | }, | 3161 | }, |
3205 | { | 3162 | { |
3206 | .ctl_name = NET_IPV4_ROUTE_REDIRECT_SILENCE, | ||
3207 | .procname = "redirect_silence", | 3163 | .procname = "redirect_silence", |
3208 | .data = &ip_rt_redirect_silence, | 3164 | .data = &ip_rt_redirect_silence, |
3209 | .maxlen = sizeof(int), | 3165 | .maxlen = sizeof(int), |
@@ -3211,7 +3167,6 @@ static ctl_table ipv4_route_table[] = { | |||
3211 | .proc_handler = proc_dointvec, | 3167 | .proc_handler = proc_dointvec, |
3212 | }, | 3168 | }, |
3213 | { | 3169 | { |
3214 | .ctl_name = NET_IPV4_ROUTE_ERROR_COST, | ||
3215 | .procname = "error_cost", | 3170 | .procname = "error_cost", |
3216 | .data = &ip_rt_error_cost, | 3171 | .data = &ip_rt_error_cost, |
3217 | .maxlen = sizeof(int), | 3172 | .maxlen = sizeof(int), |
@@ -3219,7 +3174,6 @@ static ctl_table ipv4_route_table[] = { | |||
3219 | .proc_handler = proc_dointvec, | 3174 | .proc_handler = proc_dointvec, |
3220 | }, | 3175 | }, |
3221 | { | 3176 | { |
3222 | .ctl_name = NET_IPV4_ROUTE_ERROR_BURST, | ||
3223 | .procname = "error_burst", | 3177 | .procname = "error_burst", |
3224 | .data = &ip_rt_error_burst, | 3178 | .data = &ip_rt_error_burst, |
3225 | .maxlen = sizeof(int), | 3179 | .maxlen = sizeof(int), |
@@ -3227,7 +3181,6 @@ static ctl_table ipv4_route_table[] = { | |||
3227 | .proc_handler = proc_dointvec, | 3181 | .proc_handler = proc_dointvec, |
3228 | }, | 3182 | }, |
3229 | { | 3183 | { |
3230 | .ctl_name = NET_IPV4_ROUTE_GC_ELASTICITY, | ||
3231 | .procname = "gc_elasticity", | 3184 | .procname = "gc_elasticity", |
3232 | .data = &ip_rt_gc_elasticity, | 3185 | .data = &ip_rt_gc_elasticity, |
3233 | .maxlen = sizeof(int), | 3186 | .maxlen = sizeof(int), |
@@ -3235,16 +3188,13 @@ static ctl_table ipv4_route_table[] = { | |||
3235 | .proc_handler = proc_dointvec, | 3188 | .proc_handler = proc_dointvec, |
3236 | }, | 3189 | }, |
3237 | { | 3190 | { |
3238 | .ctl_name = NET_IPV4_ROUTE_MTU_EXPIRES, | ||
3239 | .procname = "mtu_expires", | 3191 | .procname = "mtu_expires", |
3240 | .data = &ip_rt_mtu_expires, | 3192 | .data = &ip_rt_mtu_expires, |
3241 | .maxlen = sizeof(int), | 3193 | .maxlen = sizeof(int), |
3242 | .mode = 0644, | 3194 | .mode = 0644, |
3243 | .proc_handler = proc_dointvec_jiffies, | 3195 | .proc_handler = proc_dointvec_jiffies, |
3244 | .strategy = sysctl_jiffies, | ||
3245 | }, | 3196 | }, |
3246 | { | 3197 | { |
3247 | .ctl_name = NET_IPV4_ROUTE_MIN_PMTU, | ||
3248 | .procname = "min_pmtu", | 3198 | .procname = "min_pmtu", |
3249 | .data = &ip_rt_min_pmtu, | 3199 | .data = &ip_rt_min_pmtu, |
3250 | .maxlen = sizeof(int), | 3200 | .maxlen = sizeof(int), |
@@ -3252,7 +3202,6 @@ static ctl_table ipv4_route_table[] = { | |||
3252 | .proc_handler = proc_dointvec, | 3202 | .proc_handler = proc_dointvec, |
3253 | }, | 3203 | }, |
3254 | { | 3204 | { |
3255 | .ctl_name = NET_IPV4_ROUTE_MIN_ADVMSS, | ||
3256 | .procname = "min_adv_mss", | 3205 | .procname = "min_adv_mss", |
3257 | .data = &ip_rt_min_advmss, | 3206 | .data = &ip_rt_min_advmss, |
3258 | .maxlen = sizeof(int), | 3207 | .maxlen = sizeof(int), |
@@ -3260,50 +3209,46 @@ static ctl_table ipv4_route_table[] = { | |||
3260 | .proc_handler = proc_dointvec, | 3209 | .proc_handler = proc_dointvec, |
3261 | }, | 3210 | }, |
3262 | { | 3211 | { |
3263 | .ctl_name = NET_IPV4_ROUTE_SECRET_INTERVAL, | ||
3264 | .procname = "secret_interval", | 3212 | .procname = "secret_interval", |
3265 | .data = &ip_rt_secret_interval, | 3213 | .data = &ip_rt_secret_interval, |
3266 | .maxlen = sizeof(int), | 3214 | .maxlen = sizeof(int), |
3267 | .mode = 0644, | 3215 | .mode = 0644, |
3268 | .proc_handler = ipv4_sysctl_rt_secret_interval, | 3216 | .proc_handler = ipv4_sysctl_rt_secret_interval, |
3269 | .strategy = ipv4_sysctl_rt_secret_interval_strategy, | ||
3270 | }, | 3217 | }, |
3271 | { .ctl_name = 0 } | 3218 | { } |
3272 | }; | 3219 | }; |
3273 | 3220 | ||
3274 | static struct ctl_table empty[1]; | 3221 | static struct ctl_table empty[1]; |
3275 | 3222 | ||
3276 | static struct ctl_table ipv4_skeleton[] = | 3223 | static struct ctl_table ipv4_skeleton[] = |
3277 | { | 3224 | { |
3278 | { .procname = "route", .ctl_name = NET_IPV4_ROUTE, | 3225 | { .procname = "route", |
3279 | .mode = 0555, .child = ipv4_route_table}, | 3226 | .mode = 0555, .child = ipv4_route_table}, |
3280 | { .procname = "neigh", .ctl_name = NET_IPV4_NEIGH, | 3227 | { .procname = "neigh", |
3281 | .mode = 0555, .child = empty}, | 3228 | .mode = 0555, .child = empty}, |
3282 | { } | 3229 | { } |
3283 | }; | 3230 | }; |
3284 | 3231 | ||
3285 | static __net_initdata struct ctl_path ipv4_path[] = { | 3232 | static __net_initdata struct ctl_path ipv4_path[] = { |
3286 | { .procname = "net", .ctl_name = CTL_NET, }, | 3233 | { .procname = "net", }, |
3287 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 3234 | { .procname = "ipv4", }, |
3288 | { }, | 3235 | { }, |
3289 | }; | 3236 | }; |
3290 | 3237 | ||
3291 | static struct ctl_table ipv4_route_flush_table[] = { | 3238 | static struct ctl_table ipv4_route_flush_table[] = { |
3292 | { | 3239 | { |
3293 | .ctl_name = NET_IPV4_ROUTE_FLUSH, | ||
3294 | .procname = "flush", | 3240 | .procname = "flush", |
3295 | .maxlen = sizeof(int), | 3241 | .maxlen = sizeof(int), |
3296 | .mode = 0200, | 3242 | .mode = 0200, |
3297 | .proc_handler = ipv4_sysctl_rtcache_flush, | 3243 | .proc_handler = ipv4_sysctl_rtcache_flush, |
3298 | .strategy = ipv4_sysctl_rtcache_flush_strategy, | ||
3299 | }, | 3244 | }, |
3300 | { .ctl_name = 0 }, | 3245 | { }, |
3301 | }; | 3246 | }; |
3302 | 3247 | ||
3303 | static __net_initdata struct ctl_path ipv4_route_path[] = { | 3248 | static __net_initdata struct ctl_path ipv4_route_path[] = { |
3304 | { .procname = "net", .ctl_name = CTL_NET, }, | 3249 | { .procname = "net", }, |
3305 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 3250 | { .procname = "ipv4", }, |
3306 | { .procname = "route", .ctl_name = NET_IPV4_ROUTE, }, | 3251 | { .procname = "route", }, |
3307 | { }, | 3252 | { }, |
3308 | }; | 3253 | }; |
3309 | 3254 | ||
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 2dcf04d9b005..300056732953 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -63,34 +63,6 @@ static int ipv4_local_port_range(ctl_table *table, int write, | |||
63 | return ret; | 63 | return ret; |
64 | } | 64 | } |
65 | 65 | ||
66 | /* Validate changes from sysctl interface. */ | ||
67 | static int ipv4_sysctl_local_port_range(ctl_table *table, | ||
68 | void __user *oldval, | ||
69 | size_t __user *oldlenp, | ||
70 | void __user *newval, size_t newlen) | ||
71 | { | ||
72 | int ret; | ||
73 | int range[2]; | ||
74 | ctl_table tmp = { | ||
75 | .data = &range, | ||
76 | .maxlen = sizeof(range), | ||
77 | .mode = table->mode, | ||
78 | .extra1 = &ip_local_port_range_min, | ||
79 | .extra2 = &ip_local_port_range_max, | ||
80 | }; | ||
81 | |||
82 | inet_get_local_port_range(range, range + 1); | ||
83 | ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen); | ||
84 | if (ret == 0 && newval && newlen) { | ||
85 | if (range[1] < range[0]) | ||
86 | ret = -EINVAL; | ||
87 | else | ||
88 | set_local_port_range(range); | ||
89 | } | ||
90 | return ret; | ||
91 | } | ||
92 | |||
93 | |||
94 | static int proc_tcp_congestion_control(ctl_table *ctl, int write, | 66 | static int proc_tcp_congestion_control(ctl_table *ctl, int write, |
95 | void __user *buffer, size_t *lenp, loff_t *ppos) | 67 | void __user *buffer, size_t *lenp, loff_t *ppos) |
96 | { | 68 | { |
@@ -109,25 +81,6 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write, | |||
109 | return ret; | 81 | return ret; |
110 | } | 82 | } |
111 | 83 | ||
112 | static int sysctl_tcp_congestion_control(ctl_table *table, | ||
113 | void __user *oldval, | ||
114 | size_t __user *oldlenp, | ||
115 | void __user *newval, size_t newlen) | ||
116 | { | ||
117 | char val[TCP_CA_NAME_MAX]; | ||
118 | ctl_table tbl = { | ||
119 | .data = val, | ||
120 | .maxlen = TCP_CA_NAME_MAX, | ||
121 | }; | ||
122 | int ret; | ||
123 | |||
124 | tcp_get_default_congestion_control(val); | ||
125 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); | ||
126 | if (ret == 1 && newval && newlen) | ||
127 | ret = tcp_set_default_congestion_control(val); | ||
128 | return ret; | ||
129 | } | ||
130 | |||
131 | static int proc_tcp_available_congestion_control(ctl_table *ctl, | 84 | static int proc_tcp_available_congestion_control(ctl_table *ctl, |
132 | int write, | 85 | int write, |
133 | void __user *buffer, size_t *lenp, | 86 | void __user *buffer, size_t *lenp, |
@@ -165,32 +118,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl, | |||
165 | return ret; | 118 | return ret; |
166 | } | 119 | } |
167 | 120 | ||
168 | static int strategy_allowed_congestion_control(ctl_table *table, | ||
169 | void __user *oldval, | ||
170 | size_t __user *oldlenp, | ||
171 | void __user *newval, | ||
172 | size_t newlen) | ||
173 | { | ||
174 | ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX }; | ||
175 | int ret; | ||
176 | |||
177 | tbl.data = kmalloc(tbl.maxlen, GFP_USER); | ||
178 | if (!tbl.data) | ||
179 | return -ENOMEM; | ||
180 | |||
181 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); | ||
182 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); | ||
183 | if (ret == 1 && newval && newlen) | ||
184 | ret = tcp_set_allowed_congestion_control(tbl.data); | ||
185 | kfree(tbl.data); | ||
186 | |||
187 | return ret; | ||
188 | |||
189 | } | ||
190 | |||
191 | static struct ctl_table ipv4_table[] = { | 121 | static struct ctl_table ipv4_table[] = { |
192 | { | 122 | { |
193 | .ctl_name = NET_IPV4_TCP_TIMESTAMPS, | ||
194 | .procname = "tcp_timestamps", | 123 | .procname = "tcp_timestamps", |
195 | .data = &sysctl_tcp_timestamps, | 124 | .data = &sysctl_tcp_timestamps, |
196 | .maxlen = sizeof(int), | 125 | .maxlen = sizeof(int), |
@@ -198,7 +127,6 @@ static struct ctl_table ipv4_table[] = { | |||
198 | .proc_handler = proc_dointvec | 127 | .proc_handler = proc_dointvec |
199 | }, | 128 | }, |
200 | { | 129 | { |
201 | .ctl_name = NET_IPV4_TCP_WINDOW_SCALING, | ||
202 | .procname = "tcp_window_scaling", | 130 | .procname = "tcp_window_scaling", |
203 | .data = &sysctl_tcp_window_scaling, | 131 | .data = &sysctl_tcp_window_scaling, |
204 | .maxlen = sizeof(int), | 132 | .maxlen = sizeof(int), |
@@ -206,7 +134,6 @@ static struct ctl_table ipv4_table[] = { | |||
206 | .proc_handler = proc_dointvec | 134 | .proc_handler = proc_dointvec |
207 | }, | 135 | }, |
208 | { | 136 | { |
209 | .ctl_name = NET_IPV4_TCP_SACK, | ||
210 | .procname = "tcp_sack", | 137 | .procname = "tcp_sack", |
211 | .data = &sysctl_tcp_sack, | 138 | .data = &sysctl_tcp_sack, |
212 | .maxlen = sizeof(int), | 139 | .maxlen = sizeof(int), |
@@ -214,7 +141,6 @@ static struct ctl_table ipv4_table[] = { | |||
214 | .proc_handler = proc_dointvec | 141 | .proc_handler = proc_dointvec |
215 | }, | 142 | }, |
216 | { | 143 | { |
217 | .ctl_name = NET_IPV4_TCP_RETRANS_COLLAPSE, | ||
218 | .procname = "tcp_retrans_collapse", | 144 | .procname = "tcp_retrans_collapse", |
219 | .data = &sysctl_tcp_retrans_collapse, | 145 | .data = &sysctl_tcp_retrans_collapse, |
220 | .maxlen = sizeof(int), | 146 | .maxlen = sizeof(int), |
@@ -222,17 +148,14 @@ static struct ctl_table ipv4_table[] = { | |||
222 | .proc_handler = proc_dointvec | 148 | .proc_handler = proc_dointvec |
223 | }, | 149 | }, |
224 | { | 150 | { |
225 | .ctl_name = NET_IPV4_DEFAULT_TTL, | ||
226 | .procname = "ip_default_ttl", | 151 | .procname = "ip_default_ttl", |
227 | .data = &sysctl_ip_default_ttl, | 152 | .data = &sysctl_ip_default_ttl, |
228 | .maxlen = sizeof(int), | 153 | .maxlen = sizeof(int), |
229 | .mode = 0644, | 154 | .mode = 0644, |
230 | .proc_handler = ipv4_doint_and_flush, | 155 | .proc_handler = ipv4_doint_and_flush, |
231 | .strategy = ipv4_doint_and_flush_strategy, | ||
232 | .extra2 = &init_net, | 156 | .extra2 = &init_net, |
233 | }, | 157 | }, |
234 | { | 158 | { |
235 | .ctl_name = NET_IPV4_NO_PMTU_DISC, | ||
236 | .procname = "ip_no_pmtu_disc", | 159 | .procname = "ip_no_pmtu_disc", |
237 | .data = &ipv4_config.no_pmtu_disc, | 160 | .data = &ipv4_config.no_pmtu_disc, |
238 | .maxlen = sizeof(int), | 161 | .maxlen = sizeof(int), |
@@ -240,7 +163,6 @@ static struct ctl_table ipv4_table[] = { | |||
240 | .proc_handler = proc_dointvec | 163 | .proc_handler = proc_dointvec |
241 | }, | 164 | }, |
242 | { | 165 | { |
243 | .ctl_name = NET_IPV4_NONLOCAL_BIND, | ||
244 | .procname = "ip_nonlocal_bind", | 166 | .procname = "ip_nonlocal_bind", |
245 | .data = &sysctl_ip_nonlocal_bind, | 167 | .data = &sysctl_ip_nonlocal_bind, |
246 | .maxlen = sizeof(int), | 168 | .maxlen = sizeof(int), |
@@ -248,7 +170,6 @@ static struct ctl_table ipv4_table[] = { | |||
248 | .proc_handler = proc_dointvec | 170 | .proc_handler = proc_dointvec |
249 | }, | 171 | }, |
250 | { | 172 | { |
251 | .ctl_name = NET_IPV4_TCP_SYN_RETRIES, | ||
252 | .procname = "tcp_syn_retries", | 173 | .procname = "tcp_syn_retries", |
253 | .data = &sysctl_tcp_syn_retries, | 174 | .data = &sysctl_tcp_syn_retries, |
254 | .maxlen = sizeof(int), | 175 | .maxlen = sizeof(int), |
@@ -256,7 +177,6 @@ static struct ctl_table ipv4_table[] = { | |||
256 | .proc_handler = proc_dointvec | 177 | .proc_handler = proc_dointvec |
257 | }, | 178 | }, |
258 | { | 179 | { |
259 | .ctl_name = NET_TCP_SYNACK_RETRIES, | ||
260 | .procname = "tcp_synack_retries", | 180 | .procname = "tcp_synack_retries", |
261 | .data = &sysctl_tcp_synack_retries, | 181 | .data = &sysctl_tcp_synack_retries, |
262 | .maxlen = sizeof(int), | 182 | .maxlen = sizeof(int), |
@@ -264,7 +184,6 @@ static struct ctl_table ipv4_table[] = { | |||
264 | .proc_handler = proc_dointvec | 184 | .proc_handler = proc_dointvec |
265 | }, | 185 | }, |
266 | { | 186 | { |
267 | .ctl_name = NET_TCP_MAX_ORPHANS, | ||
268 | .procname = "tcp_max_orphans", | 187 | .procname = "tcp_max_orphans", |
269 | .data = &sysctl_tcp_max_orphans, | 188 | .data = &sysctl_tcp_max_orphans, |
270 | .maxlen = sizeof(int), | 189 | .maxlen = sizeof(int), |
@@ -272,7 +191,6 @@ static struct ctl_table ipv4_table[] = { | |||
272 | .proc_handler = proc_dointvec | 191 | .proc_handler = proc_dointvec |
273 | }, | 192 | }, |
274 | { | 193 | { |
275 | .ctl_name = NET_TCP_MAX_TW_BUCKETS, | ||
276 | .procname = "tcp_max_tw_buckets", | 194 | .procname = "tcp_max_tw_buckets", |
277 | .data = &tcp_death_row.sysctl_max_tw_buckets, | 195 | .data = &tcp_death_row.sysctl_max_tw_buckets, |
278 | .maxlen = sizeof(int), | 196 | .maxlen = sizeof(int), |
@@ -280,7 +198,6 @@ static struct ctl_table ipv4_table[] = { | |||
280 | .proc_handler = proc_dointvec | 198 | .proc_handler = proc_dointvec |
281 | }, | 199 | }, |
282 | { | 200 | { |
283 | .ctl_name = NET_IPV4_DYNADDR, | ||
284 | .procname = "ip_dynaddr", | 201 | .procname = "ip_dynaddr", |
285 | .data = &sysctl_ip_dynaddr, | 202 | .data = &sysctl_ip_dynaddr, |
286 | .maxlen = sizeof(int), | 203 | .maxlen = sizeof(int), |
@@ -288,16 +205,13 @@ static struct ctl_table ipv4_table[] = { | |||
288 | .proc_handler = proc_dointvec | 205 | .proc_handler = proc_dointvec |
289 | }, | 206 | }, |
290 | { | 207 | { |
291 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_TIME, | ||
292 | .procname = "tcp_keepalive_time", | 208 | .procname = "tcp_keepalive_time", |
293 | .data = &sysctl_tcp_keepalive_time, | 209 | .data = &sysctl_tcp_keepalive_time, |
294 | .maxlen = sizeof(int), | 210 | .maxlen = sizeof(int), |
295 | .mode = 0644, | 211 | .mode = 0644, |
296 | .proc_handler = proc_dointvec_jiffies, | 212 | .proc_handler = proc_dointvec_jiffies, |
297 | .strategy = sysctl_jiffies | ||
298 | }, | 213 | }, |
299 | { | 214 | { |
300 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_PROBES, | ||
301 | .procname = "tcp_keepalive_probes", | 215 | .procname = "tcp_keepalive_probes", |
302 | .data = &sysctl_tcp_keepalive_probes, | 216 | .data = &sysctl_tcp_keepalive_probes, |
303 | .maxlen = sizeof(int), | 217 | .maxlen = sizeof(int), |
@@ -305,26 +219,21 @@ static struct ctl_table ipv4_table[] = { | |||
305 | .proc_handler = proc_dointvec | 219 | .proc_handler = proc_dointvec |
306 | }, | 220 | }, |
307 | { | 221 | { |
308 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_INTVL, | ||
309 | .procname = "tcp_keepalive_intvl", | 222 | .procname = "tcp_keepalive_intvl", |
310 | .data = &sysctl_tcp_keepalive_intvl, | 223 | .data = &sysctl_tcp_keepalive_intvl, |
311 | .maxlen = sizeof(int), | 224 | .maxlen = sizeof(int), |
312 | .mode = 0644, | 225 | .mode = 0644, |
313 | .proc_handler = proc_dointvec_jiffies, | 226 | .proc_handler = proc_dointvec_jiffies, |
314 | .strategy = sysctl_jiffies | ||
315 | }, | 227 | }, |
316 | { | 228 | { |
317 | .ctl_name = NET_IPV4_TCP_RETRIES1, | ||
318 | .procname = "tcp_retries1", | 229 | .procname = "tcp_retries1", |
319 | .data = &sysctl_tcp_retries1, | 230 | .data = &sysctl_tcp_retries1, |
320 | .maxlen = sizeof(int), | 231 | .maxlen = sizeof(int), |
321 | .mode = 0644, | 232 | .mode = 0644, |
322 | .proc_handler = proc_dointvec_minmax, | 233 | .proc_handler = proc_dointvec_minmax, |
323 | .strategy = sysctl_intvec, | ||
324 | .extra2 = &tcp_retr1_max | 234 | .extra2 = &tcp_retr1_max |
325 | }, | 235 | }, |
326 | { | 236 | { |
327 | .ctl_name = NET_IPV4_TCP_RETRIES2, | ||
328 | .procname = "tcp_retries2", | 237 | .procname = "tcp_retries2", |
329 | .data = &sysctl_tcp_retries2, | 238 | .data = &sysctl_tcp_retries2, |
330 | .maxlen = sizeof(int), | 239 | .maxlen = sizeof(int), |
@@ -332,17 +241,14 @@ static struct ctl_table ipv4_table[] = { | |||
332 | .proc_handler = proc_dointvec | 241 | .proc_handler = proc_dointvec |
333 | }, | 242 | }, |
334 | { | 243 | { |
335 | .ctl_name = NET_IPV4_TCP_FIN_TIMEOUT, | ||
336 | .procname = "tcp_fin_timeout", | 244 | .procname = "tcp_fin_timeout", |
337 | .data = &sysctl_tcp_fin_timeout, | 245 | .data = &sysctl_tcp_fin_timeout, |
338 | .maxlen = sizeof(int), | 246 | .maxlen = sizeof(int), |
339 | .mode = 0644, | 247 | .mode = 0644, |
340 | .proc_handler = proc_dointvec_jiffies, | 248 | .proc_handler = proc_dointvec_jiffies, |
341 | .strategy = sysctl_jiffies | ||
342 | }, | 249 | }, |
343 | #ifdef CONFIG_SYN_COOKIES | 250 | #ifdef CONFIG_SYN_COOKIES |
344 | { | 251 | { |
345 | .ctl_name = NET_TCP_SYNCOOKIES, | ||
346 | .procname = "tcp_syncookies", | 252 | .procname = "tcp_syncookies", |
347 | .data = &sysctl_tcp_syncookies, | 253 | .data = &sysctl_tcp_syncookies, |
348 | .maxlen = sizeof(int), | 254 | .maxlen = sizeof(int), |
@@ -351,7 +257,6 @@ static struct ctl_table ipv4_table[] = { | |||
351 | }, | 257 | }, |
352 | #endif | 258 | #endif |
353 | { | 259 | { |
354 | .ctl_name = NET_TCP_TW_RECYCLE, | ||
355 | .procname = "tcp_tw_recycle", | 260 | .procname = "tcp_tw_recycle", |
356 | .data = &tcp_death_row.sysctl_tw_recycle, | 261 | .data = &tcp_death_row.sysctl_tw_recycle, |
357 | .maxlen = sizeof(int), | 262 | .maxlen = sizeof(int), |
@@ -359,7 +264,6 @@ static struct ctl_table ipv4_table[] = { | |||
359 | .proc_handler = proc_dointvec | 264 | .proc_handler = proc_dointvec |
360 | }, | 265 | }, |
361 | { | 266 | { |
362 | .ctl_name = NET_TCP_ABORT_ON_OVERFLOW, | ||
363 | .procname = "tcp_abort_on_overflow", | 267 | .procname = "tcp_abort_on_overflow", |
364 | .data = &sysctl_tcp_abort_on_overflow, | 268 | .data = &sysctl_tcp_abort_on_overflow, |
365 | .maxlen = sizeof(int), | 269 | .maxlen = sizeof(int), |
@@ -367,7 +271,6 @@ static struct ctl_table ipv4_table[] = { | |||
367 | .proc_handler = proc_dointvec | 271 | .proc_handler = proc_dointvec |
368 | }, | 272 | }, |
369 | { | 273 | { |
370 | .ctl_name = NET_TCP_STDURG, | ||
371 | .procname = "tcp_stdurg", | 274 | .procname = "tcp_stdurg", |
372 | .data = &sysctl_tcp_stdurg, | 275 | .data = &sysctl_tcp_stdurg, |
373 | .maxlen = sizeof(int), | 276 | .maxlen = sizeof(int), |
@@ -375,7 +278,6 @@ static struct ctl_table ipv4_table[] = { | |||
375 | .proc_handler = proc_dointvec | 278 | .proc_handler = proc_dointvec |
376 | }, | 279 | }, |
377 | { | 280 | { |
378 | .ctl_name = NET_TCP_RFC1337, | ||
379 | .procname = "tcp_rfc1337", | 281 | .procname = "tcp_rfc1337", |
380 | .data = &sysctl_tcp_rfc1337, | 282 | .data = &sysctl_tcp_rfc1337, |
381 | .maxlen = sizeof(int), | 283 | .maxlen = sizeof(int), |
@@ -383,7 +285,6 @@ static struct ctl_table ipv4_table[] = { | |||
383 | .proc_handler = proc_dointvec | 285 | .proc_handler = proc_dointvec |
384 | }, | 286 | }, |
385 | { | 287 | { |
386 | .ctl_name = NET_TCP_MAX_SYN_BACKLOG, | ||
387 | .procname = "tcp_max_syn_backlog", | 288 | .procname = "tcp_max_syn_backlog", |
388 | .data = &sysctl_max_syn_backlog, | 289 | .data = &sysctl_max_syn_backlog, |
389 | .maxlen = sizeof(int), | 290 | .maxlen = sizeof(int), |
@@ -391,17 +292,14 @@ static struct ctl_table ipv4_table[] = { | |||
391 | .proc_handler = proc_dointvec | 292 | .proc_handler = proc_dointvec |
392 | }, | 293 | }, |
393 | { | 294 | { |
394 | .ctl_name = NET_IPV4_LOCAL_PORT_RANGE, | ||
395 | .procname = "ip_local_port_range", | 295 | .procname = "ip_local_port_range", |
396 | .data = &sysctl_local_ports.range, | 296 | .data = &sysctl_local_ports.range, |
397 | .maxlen = sizeof(sysctl_local_ports.range), | 297 | .maxlen = sizeof(sysctl_local_ports.range), |
398 | .mode = 0644, | 298 | .mode = 0644, |
399 | .proc_handler = ipv4_local_port_range, | 299 | .proc_handler = ipv4_local_port_range, |
400 | .strategy = ipv4_sysctl_local_port_range, | ||
401 | }, | 300 | }, |
402 | #ifdef CONFIG_IP_MULTICAST | 301 | #ifdef CONFIG_IP_MULTICAST |
403 | { | 302 | { |
404 | .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS, | ||
405 | .procname = "igmp_max_memberships", | 303 | .procname = "igmp_max_memberships", |
406 | .data = &sysctl_igmp_max_memberships, | 304 | .data = &sysctl_igmp_max_memberships, |
407 | .maxlen = sizeof(int), | 305 | .maxlen = sizeof(int), |
@@ -411,7 +309,6 @@ static struct ctl_table ipv4_table[] = { | |||
411 | 309 | ||
412 | #endif | 310 | #endif |
413 | { | 311 | { |
414 | .ctl_name = NET_IPV4_IGMP_MAX_MSF, | ||
415 | .procname = "igmp_max_msf", | 312 | .procname = "igmp_max_msf", |
416 | .data = &sysctl_igmp_max_msf, | 313 | .data = &sysctl_igmp_max_msf, |
417 | .maxlen = sizeof(int), | 314 | .maxlen = sizeof(int), |
@@ -419,7 +316,6 @@ static struct ctl_table ipv4_table[] = { | |||
419 | .proc_handler = proc_dointvec | 316 | .proc_handler = proc_dointvec |
420 | }, | 317 | }, |
421 | { | 318 | { |
422 | .ctl_name = NET_IPV4_INET_PEER_THRESHOLD, | ||
423 | .procname = "inet_peer_threshold", | 319 | .procname = "inet_peer_threshold", |
424 | .data = &inet_peer_threshold, | 320 | .data = &inet_peer_threshold, |
425 | .maxlen = sizeof(int), | 321 | .maxlen = sizeof(int), |
@@ -427,43 +323,34 @@ static struct ctl_table ipv4_table[] = { | |||
427 | .proc_handler = proc_dointvec | 323 | .proc_handler = proc_dointvec |
428 | }, | 324 | }, |
429 | { | 325 | { |
430 | .ctl_name = NET_IPV4_INET_PEER_MINTTL, | ||
431 | .procname = "inet_peer_minttl", | 326 | .procname = "inet_peer_minttl", |
432 | .data = &inet_peer_minttl, | 327 | .data = &inet_peer_minttl, |
433 | .maxlen = sizeof(int), | 328 | .maxlen = sizeof(int), |
434 | .mode = 0644, | 329 | .mode = 0644, |
435 | .proc_handler = proc_dointvec_jiffies, | 330 | .proc_handler = proc_dointvec_jiffies, |
436 | .strategy = sysctl_jiffies | ||
437 | }, | 331 | }, |
438 | { | 332 | { |
439 | .ctl_name = NET_IPV4_INET_PEER_MAXTTL, | ||
440 | .procname = "inet_peer_maxttl", | 333 | .procname = "inet_peer_maxttl", |
441 | .data = &inet_peer_maxttl, | 334 | .data = &inet_peer_maxttl, |
442 | .maxlen = sizeof(int), | 335 | .maxlen = sizeof(int), |
443 | .mode = 0644, | 336 | .mode = 0644, |
444 | .proc_handler = proc_dointvec_jiffies, | 337 | .proc_handler = proc_dointvec_jiffies, |
445 | .strategy = sysctl_jiffies | ||
446 | }, | 338 | }, |
447 | { | 339 | { |
448 | .ctl_name = NET_IPV4_INET_PEER_GC_MINTIME, | ||
449 | .procname = "inet_peer_gc_mintime", | 340 | .procname = "inet_peer_gc_mintime", |
450 | .data = &inet_peer_gc_mintime, | 341 | .data = &inet_peer_gc_mintime, |
451 | .maxlen = sizeof(int), | 342 | .maxlen = sizeof(int), |
452 | .mode = 0644, | 343 | .mode = 0644, |
453 | .proc_handler = proc_dointvec_jiffies, | 344 | .proc_handler = proc_dointvec_jiffies, |
454 | .strategy = sysctl_jiffies | ||
455 | }, | 345 | }, |
456 | { | 346 | { |
457 | .ctl_name = NET_IPV4_INET_PEER_GC_MAXTIME, | ||
458 | .procname = "inet_peer_gc_maxtime", | 347 | .procname = "inet_peer_gc_maxtime", |
459 | .data = &inet_peer_gc_maxtime, | 348 | .data = &inet_peer_gc_maxtime, |
460 | .maxlen = sizeof(int), | 349 | .maxlen = sizeof(int), |
461 | .mode = 0644, | 350 | .mode = 0644, |
462 | .proc_handler = proc_dointvec_jiffies, | 351 | .proc_handler = proc_dointvec_jiffies, |
463 | .strategy = sysctl_jiffies | ||
464 | }, | 352 | }, |
465 | { | 353 | { |
466 | .ctl_name = NET_TCP_ORPHAN_RETRIES, | ||
467 | .procname = "tcp_orphan_retries", | 354 | .procname = "tcp_orphan_retries", |
468 | .data = &sysctl_tcp_orphan_retries, | 355 | .data = &sysctl_tcp_orphan_retries, |
469 | .maxlen = sizeof(int), | 356 | .maxlen = sizeof(int), |
@@ -471,7 +358,6 @@ static struct ctl_table ipv4_table[] = { | |||
471 | .proc_handler = proc_dointvec | 358 | .proc_handler = proc_dointvec |
472 | }, | 359 | }, |
473 | { | 360 | { |
474 | .ctl_name = NET_TCP_FACK, | ||
475 | .procname = "tcp_fack", | 361 | .procname = "tcp_fack", |
476 | .data = &sysctl_tcp_fack, | 362 | .data = &sysctl_tcp_fack, |
477 | .maxlen = sizeof(int), | 363 | .maxlen = sizeof(int), |
@@ -479,7 +365,6 @@ static struct ctl_table ipv4_table[] = { | |||
479 | .proc_handler = proc_dointvec | 365 | .proc_handler = proc_dointvec |
480 | }, | 366 | }, |
481 | { | 367 | { |
482 | .ctl_name = NET_TCP_REORDERING, | ||
483 | .procname = "tcp_reordering", | 368 | .procname = "tcp_reordering", |
484 | .data = &sysctl_tcp_reordering, | 369 | .data = &sysctl_tcp_reordering, |
485 | .maxlen = sizeof(int), | 370 | .maxlen = sizeof(int), |
@@ -487,7 +372,6 @@ static struct ctl_table ipv4_table[] = { | |||
487 | .proc_handler = proc_dointvec | 372 | .proc_handler = proc_dointvec |
488 | }, | 373 | }, |
489 | { | 374 | { |
490 | .ctl_name = NET_TCP_ECN, | ||
491 | .procname = "tcp_ecn", | 375 | .procname = "tcp_ecn", |
492 | .data = &sysctl_tcp_ecn, | 376 | .data = &sysctl_tcp_ecn, |
493 | .maxlen = sizeof(int), | 377 | .maxlen = sizeof(int), |
@@ -495,7 +379,6 @@ static struct ctl_table ipv4_table[] = { | |||
495 | .proc_handler = proc_dointvec | 379 | .proc_handler = proc_dointvec |
496 | }, | 380 | }, |
497 | { | 381 | { |
498 | .ctl_name = NET_TCP_DSACK, | ||
499 | .procname = "tcp_dsack", | 382 | .procname = "tcp_dsack", |
500 | .data = &sysctl_tcp_dsack, | 383 | .data = &sysctl_tcp_dsack, |
501 | .maxlen = sizeof(int), | 384 | .maxlen = sizeof(int), |
@@ -503,7 +386,6 @@ static struct ctl_table ipv4_table[] = { | |||
503 | .proc_handler = proc_dointvec | 386 | .proc_handler = proc_dointvec |
504 | }, | 387 | }, |
505 | { | 388 | { |
506 | .ctl_name = NET_TCP_MEM, | ||
507 | .procname = "tcp_mem", | 389 | .procname = "tcp_mem", |
508 | .data = &sysctl_tcp_mem, | 390 | .data = &sysctl_tcp_mem, |
509 | .maxlen = sizeof(sysctl_tcp_mem), | 391 | .maxlen = sizeof(sysctl_tcp_mem), |
@@ -511,7 +393,6 @@ static struct ctl_table ipv4_table[] = { | |||
511 | .proc_handler = proc_dointvec | 393 | .proc_handler = proc_dointvec |
512 | }, | 394 | }, |
513 | { | 395 | { |
514 | .ctl_name = NET_TCP_WMEM, | ||
515 | .procname = "tcp_wmem", | 396 | .procname = "tcp_wmem", |
516 | .data = &sysctl_tcp_wmem, | 397 | .data = &sysctl_tcp_wmem, |
517 | .maxlen = sizeof(sysctl_tcp_wmem), | 398 | .maxlen = sizeof(sysctl_tcp_wmem), |
@@ -519,7 +400,6 @@ static struct ctl_table ipv4_table[] = { | |||
519 | .proc_handler = proc_dointvec | 400 | .proc_handler = proc_dointvec |
520 | }, | 401 | }, |
521 | { | 402 | { |
522 | .ctl_name = NET_TCP_RMEM, | ||
523 | .procname = "tcp_rmem", | 403 | .procname = "tcp_rmem", |
524 | .data = &sysctl_tcp_rmem, | 404 | .data = &sysctl_tcp_rmem, |
525 | .maxlen = sizeof(sysctl_tcp_rmem), | 405 | .maxlen = sizeof(sysctl_tcp_rmem), |
@@ -527,7 +407,6 @@ static struct ctl_table ipv4_table[] = { | |||
527 | .proc_handler = proc_dointvec | 407 | .proc_handler = proc_dointvec |
528 | }, | 408 | }, |
529 | { | 409 | { |
530 | .ctl_name = NET_TCP_APP_WIN, | ||
531 | .procname = "tcp_app_win", | 410 | .procname = "tcp_app_win", |
532 | .data = &sysctl_tcp_app_win, | 411 | .data = &sysctl_tcp_app_win, |
533 | .maxlen = sizeof(int), | 412 | .maxlen = sizeof(int), |
@@ -535,7 +414,6 @@ static struct ctl_table ipv4_table[] = { | |||
535 | .proc_handler = proc_dointvec | 414 | .proc_handler = proc_dointvec |
536 | }, | 415 | }, |
537 | { | 416 | { |
538 | .ctl_name = NET_TCP_ADV_WIN_SCALE, | ||
539 | .procname = "tcp_adv_win_scale", | 417 | .procname = "tcp_adv_win_scale", |
540 | .data = &sysctl_tcp_adv_win_scale, | 418 | .data = &sysctl_tcp_adv_win_scale, |
541 | .maxlen = sizeof(int), | 419 | .maxlen = sizeof(int), |
@@ -543,7 +421,6 @@ static struct ctl_table ipv4_table[] = { | |||
543 | .proc_handler = proc_dointvec | 421 | .proc_handler = proc_dointvec |
544 | }, | 422 | }, |
545 | { | 423 | { |
546 | .ctl_name = NET_TCP_TW_REUSE, | ||
547 | .procname = "tcp_tw_reuse", | 424 | .procname = "tcp_tw_reuse", |
548 | .data = &sysctl_tcp_tw_reuse, | 425 | .data = &sysctl_tcp_tw_reuse, |
549 | .maxlen = sizeof(int), | 426 | .maxlen = sizeof(int), |
@@ -551,7 +428,6 @@ static struct ctl_table ipv4_table[] = { | |||
551 | .proc_handler = proc_dointvec | 428 | .proc_handler = proc_dointvec |
552 | }, | 429 | }, |
553 | { | 430 | { |
554 | .ctl_name = NET_TCP_FRTO, | ||
555 | .procname = "tcp_frto", | 431 | .procname = "tcp_frto", |
556 | .data = &sysctl_tcp_frto, | 432 | .data = &sysctl_tcp_frto, |
557 | .maxlen = sizeof(int), | 433 | .maxlen = sizeof(int), |
@@ -559,7 +435,6 @@ static struct ctl_table ipv4_table[] = { | |||
559 | .proc_handler = proc_dointvec | 435 | .proc_handler = proc_dointvec |
560 | }, | 436 | }, |
561 | { | 437 | { |
562 | .ctl_name = NET_TCP_FRTO_RESPONSE, | ||
563 | .procname = "tcp_frto_response", | 438 | .procname = "tcp_frto_response", |
564 | .data = &sysctl_tcp_frto_response, | 439 | .data = &sysctl_tcp_frto_response, |
565 | .maxlen = sizeof(int), | 440 | .maxlen = sizeof(int), |
@@ -567,7 +442,6 @@ static struct ctl_table ipv4_table[] = { | |||
567 | .proc_handler = proc_dointvec | 442 | .proc_handler = proc_dointvec |
568 | }, | 443 | }, |
569 | { | 444 | { |
570 | .ctl_name = NET_TCP_LOW_LATENCY, | ||
571 | .procname = "tcp_low_latency", | 445 | .procname = "tcp_low_latency", |
572 | .data = &sysctl_tcp_low_latency, | 446 | .data = &sysctl_tcp_low_latency, |
573 | .maxlen = sizeof(int), | 447 | .maxlen = sizeof(int), |
@@ -575,7 +449,6 @@ static struct ctl_table ipv4_table[] = { | |||
575 | .proc_handler = proc_dointvec | 449 | .proc_handler = proc_dointvec |
576 | }, | 450 | }, |
577 | { | 451 | { |
578 | .ctl_name = NET_TCP_NO_METRICS_SAVE, | ||
579 | .procname = "tcp_no_metrics_save", | 452 | .procname = "tcp_no_metrics_save", |
580 | .data = &sysctl_tcp_nometrics_save, | 453 | .data = &sysctl_tcp_nometrics_save, |
581 | .maxlen = sizeof(int), | 454 | .maxlen = sizeof(int), |
@@ -583,7 +456,6 @@ static struct ctl_table ipv4_table[] = { | |||
583 | .proc_handler = proc_dointvec, | 456 | .proc_handler = proc_dointvec, |
584 | }, | 457 | }, |
585 | { | 458 | { |
586 | .ctl_name = NET_TCP_MODERATE_RCVBUF, | ||
587 | .procname = "tcp_moderate_rcvbuf", | 459 | .procname = "tcp_moderate_rcvbuf", |
588 | .data = &sysctl_tcp_moderate_rcvbuf, | 460 | .data = &sysctl_tcp_moderate_rcvbuf, |
589 | .maxlen = sizeof(int), | 461 | .maxlen = sizeof(int), |
@@ -591,7 +463,6 @@ static struct ctl_table ipv4_table[] = { | |||
591 | .proc_handler = proc_dointvec, | 463 | .proc_handler = proc_dointvec, |
592 | }, | 464 | }, |
593 | { | 465 | { |
594 | .ctl_name = NET_TCP_TSO_WIN_DIVISOR, | ||
595 | .procname = "tcp_tso_win_divisor", | 466 | .procname = "tcp_tso_win_divisor", |
596 | .data = &sysctl_tcp_tso_win_divisor, | 467 | .data = &sysctl_tcp_tso_win_divisor, |
597 | .maxlen = sizeof(int), | 468 | .maxlen = sizeof(int), |
@@ -599,15 +470,12 @@ static struct ctl_table ipv4_table[] = { | |||
599 | .proc_handler = proc_dointvec, | 470 | .proc_handler = proc_dointvec, |
600 | }, | 471 | }, |
601 | { | 472 | { |
602 | .ctl_name = NET_TCP_CONG_CONTROL, | ||
603 | .procname = "tcp_congestion_control", | 473 | .procname = "tcp_congestion_control", |
604 | .mode = 0644, | 474 | .mode = 0644, |
605 | .maxlen = TCP_CA_NAME_MAX, | 475 | .maxlen = TCP_CA_NAME_MAX, |
606 | .proc_handler = proc_tcp_congestion_control, | 476 | .proc_handler = proc_tcp_congestion_control, |
607 | .strategy = sysctl_tcp_congestion_control, | ||
608 | }, | 477 | }, |
609 | { | 478 | { |
610 | .ctl_name = NET_TCP_ABC, | ||
611 | .procname = "tcp_abc", | 479 | .procname = "tcp_abc", |
612 | .data = &sysctl_tcp_abc, | 480 | .data = &sysctl_tcp_abc, |
613 | .maxlen = sizeof(int), | 481 | .maxlen = sizeof(int), |
@@ -615,7 +483,6 @@ static struct ctl_table ipv4_table[] = { | |||
615 | .proc_handler = proc_dointvec, | 483 | .proc_handler = proc_dointvec, |
616 | }, | 484 | }, |
617 | { | 485 | { |
618 | .ctl_name = NET_TCP_MTU_PROBING, | ||
619 | .procname = "tcp_mtu_probing", | 486 | .procname = "tcp_mtu_probing", |
620 | .data = &sysctl_tcp_mtu_probing, | 487 | .data = &sysctl_tcp_mtu_probing, |
621 | .maxlen = sizeof(int), | 488 | .maxlen = sizeof(int), |
@@ -623,7 +490,6 @@ static struct ctl_table ipv4_table[] = { | |||
623 | .proc_handler = proc_dointvec, | 490 | .proc_handler = proc_dointvec, |
624 | }, | 491 | }, |
625 | { | 492 | { |
626 | .ctl_name = NET_TCP_BASE_MSS, | ||
627 | .procname = "tcp_base_mss", | 493 | .procname = "tcp_base_mss", |
628 | .data = &sysctl_tcp_base_mss, | 494 | .data = &sysctl_tcp_base_mss, |
629 | .maxlen = sizeof(int), | 495 | .maxlen = sizeof(int), |
@@ -631,7 +497,6 @@ static struct ctl_table ipv4_table[] = { | |||
631 | .proc_handler = proc_dointvec, | 497 | .proc_handler = proc_dointvec, |
632 | }, | 498 | }, |
633 | { | 499 | { |
634 | .ctl_name = NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, | ||
635 | .procname = "tcp_workaround_signed_windows", | 500 | .procname = "tcp_workaround_signed_windows", |
636 | .data = &sysctl_tcp_workaround_signed_windows, | 501 | .data = &sysctl_tcp_workaround_signed_windows, |
637 | .maxlen = sizeof(int), | 502 | .maxlen = sizeof(int), |
@@ -640,7 +505,6 @@ static struct ctl_table ipv4_table[] = { | |||
640 | }, | 505 | }, |
641 | #ifdef CONFIG_NET_DMA | 506 | #ifdef CONFIG_NET_DMA |
642 | { | 507 | { |
643 | .ctl_name = NET_TCP_DMA_COPYBREAK, | ||
644 | .procname = "tcp_dma_copybreak", | 508 | .procname = "tcp_dma_copybreak", |
645 | .data = &sysctl_tcp_dma_copybreak, | 509 | .data = &sysctl_tcp_dma_copybreak, |
646 | .maxlen = sizeof(int), | 510 | .maxlen = sizeof(int), |
@@ -649,7 +513,6 @@ static struct ctl_table ipv4_table[] = { | |||
649 | }, | 513 | }, |
650 | #endif | 514 | #endif |
651 | { | 515 | { |
652 | .ctl_name = NET_TCP_SLOW_START_AFTER_IDLE, | ||
653 | .procname = "tcp_slow_start_after_idle", | 516 | .procname = "tcp_slow_start_after_idle", |
654 | .data = &sysctl_tcp_slow_start_after_idle, | 517 | .data = &sysctl_tcp_slow_start_after_idle, |
655 | .maxlen = sizeof(int), | 518 | .maxlen = sizeof(int), |
@@ -658,7 +521,6 @@ static struct ctl_table ipv4_table[] = { | |||
658 | }, | 521 | }, |
659 | #ifdef CONFIG_NETLABEL | 522 | #ifdef CONFIG_NETLABEL |
660 | { | 523 | { |
661 | .ctl_name = NET_CIPSOV4_CACHE_ENABLE, | ||
662 | .procname = "cipso_cache_enable", | 524 | .procname = "cipso_cache_enable", |
663 | .data = &cipso_v4_cache_enabled, | 525 | .data = &cipso_v4_cache_enabled, |
664 | .maxlen = sizeof(int), | 526 | .maxlen = sizeof(int), |
@@ -666,7 +528,6 @@ static struct ctl_table ipv4_table[] = { | |||
666 | .proc_handler = proc_dointvec, | 528 | .proc_handler = proc_dointvec, |
667 | }, | 529 | }, |
668 | { | 530 | { |
669 | .ctl_name = NET_CIPSOV4_CACHE_BUCKET_SIZE, | ||
670 | .procname = "cipso_cache_bucket_size", | 531 | .procname = "cipso_cache_bucket_size", |
671 | .data = &cipso_v4_cache_bucketsize, | 532 | .data = &cipso_v4_cache_bucketsize, |
672 | .maxlen = sizeof(int), | 533 | .maxlen = sizeof(int), |
@@ -674,7 +535,6 @@ static struct ctl_table ipv4_table[] = { | |||
674 | .proc_handler = proc_dointvec, | 535 | .proc_handler = proc_dointvec, |
675 | }, | 536 | }, |
676 | { | 537 | { |
677 | .ctl_name = NET_CIPSOV4_RBM_OPTFMT, | ||
678 | .procname = "cipso_rbm_optfmt", | 538 | .procname = "cipso_rbm_optfmt", |
679 | .data = &cipso_v4_rbm_optfmt, | 539 | .data = &cipso_v4_rbm_optfmt, |
680 | .maxlen = sizeof(int), | 540 | .maxlen = sizeof(int), |
@@ -682,7 +542,6 @@ static struct ctl_table ipv4_table[] = { | |||
682 | .proc_handler = proc_dointvec, | 542 | .proc_handler = proc_dointvec, |
683 | }, | 543 | }, |
684 | { | 544 | { |
685 | .ctl_name = NET_CIPSOV4_RBM_STRICTVALID, | ||
686 | .procname = "cipso_rbm_strictvalid", | 545 | .procname = "cipso_rbm_strictvalid", |
687 | .data = &cipso_v4_rbm_strictvalid, | 546 | .data = &cipso_v4_rbm_strictvalid, |
688 | .maxlen = sizeof(int), | 547 | .maxlen = sizeof(int), |
@@ -697,15 +556,12 @@ static struct ctl_table ipv4_table[] = { | |||
697 | .proc_handler = proc_tcp_available_congestion_control, | 556 | .proc_handler = proc_tcp_available_congestion_control, |
698 | }, | 557 | }, |
699 | { | 558 | { |
700 | .ctl_name = NET_TCP_ALLOWED_CONG_CONTROL, | ||
701 | .procname = "tcp_allowed_congestion_control", | 559 | .procname = "tcp_allowed_congestion_control", |
702 | .maxlen = TCP_CA_BUF_MAX, | 560 | .maxlen = TCP_CA_BUF_MAX, |
703 | .mode = 0644, | 561 | .mode = 0644, |
704 | .proc_handler = proc_allowed_congestion_control, | 562 | .proc_handler = proc_allowed_congestion_control, |
705 | .strategy = strategy_allowed_congestion_control, | ||
706 | }, | 563 | }, |
707 | { | 564 | { |
708 | .ctl_name = NET_TCP_MAX_SSTHRESH, | ||
709 | .procname = "tcp_max_ssthresh", | 565 | .procname = "tcp_max_ssthresh", |
710 | .data = &sysctl_tcp_max_ssthresh, | 566 | .data = &sysctl_tcp_max_ssthresh, |
711 | .maxlen = sizeof(int), | 567 | .maxlen = sizeof(int), |
@@ -713,41 +569,34 @@ static struct ctl_table ipv4_table[] = { | |||
713 | .proc_handler = proc_dointvec, | 569 | .proc_handler = proc_dointvec, |
714 | }, | 570 | }, |
715 | { | 571 | { |
716 | .ctl_name = CTL_UNNUMBERED, | ||
717 | .procname = "udp_mem", | 572 | .procname = "udp_mem", |
718 | .data = &sysctl_udp_mem, | 573 | .data = &sysctl_udp_mem, |
719 | .maxlen = sizeof(sysctl_udp_mem), | 574 | .maxlen = sizeof(sysctl_udp_mem), |
720 | .mode = 0644, | 575 | .mode = 0644, |
721 | .proc_handler = proc_dointvec_minmax, | 576 | .proc_handler = proc_dointvec_minmax, |
722 | .strategy = sysctl_intvec, | ||
723 | .extra1 = &zero | 577 | .extra1 = &zero |
724 | }, | 578 | }, |
725 | { | 579 | { |
726 | .ctl_name = CTL_UNNUMBERED, | ||
727 | .procname = "udp_rmem_min", | 580 | .procname = "udp_rmem_min", |
728 | .data = &sysctl_udp_rmem_min, | 581 | .data = &sysctl_udp_rmem_min, |
729 | .maxlen = sizeof(sysctl_udp_rmem_min), | 582 | .maxlen = sizeof(sysctl_udp_rmem_min), |
730 | .mode = 0644, | 583 | .mode = 0644, |
731 | .proc_handler = proc_dointvec_minmax, | 584 | .proc_handler = proc_dointvec_minmax, |
732 | .strategy = sysctl_intvec, | ||
733 | .extra1 = &zero | 585 | .extra1 = &zero |
734 | }, | 586 | }, |
735 | { | 587 | { |
736 | .ctl_name = CTL_UNNUMBERED, | ||
737 | .procname = "udp_wmem_min", | 588 | .procname = "udp_wmem_min", |
738 | .data = &sysctl_udp_wmem_min, | 589 | .data = &sysctl_udp_wmem_min, |
739 | .maxlen = sizeof(sysctl_udp_wmem_min), | 590 | .maxlen = sizeof(sysctl_udp_wmem_min), |
740 | .mode = 0644, | 591 | .mode = 0644, |
741 | .proc_handler = proc_dointvec_minmax, | 592 | .proc_handler = proc_dointvec_minmax, |
742 | .strategy = sysctl_intvec, | ||
743 | .extra1 = &zero | 593 | .extra1 = &zero |
744 | }, | 594 | }, |
745 | { .ctl_name = 0 } | 595 | { } |
746 | }; | 596 | }; |
747 | 597 | ||
748 | static struct ctl_table ipv4_net_table[] = { | 598 | static struct ctl_table ipv4_net_table[] = { |
749 | { | 599 | { |
750 | .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_ALL, | ||
751 | .procname = "icmp_echo_ignore_all", | 600 | .procname = "icmp_echo_ignore_all", |
752 | .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all, | 601 | .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all, |
753 | .maxlen = sizeof(int), | 602 | .maxlen = sizeof(int), |
@@ -755,7 +604,6 @@ static struct ctl_table ipv4_net_table[] = { | |||
755 | .proc_handler = proc_dointvec | 604 | .proc_handler = proc_dointvec |
756 | }, | 605 | }, |
757 | { | 606 | { |
758 | .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, | ||
759 | .procname = "icmp_echo_ignore_broadcasts", | 607 | .procname = "icmp_echo_ignore_broadcasts", |
760 | .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts, | 608 | .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts, |
761 | .maxlen = sizeof(int), | 609 | .maxlen = sizeof(int), |
@@ -763,7 +611,6 @@ static struct ctl_table ipv4_net_table[] = { | |||
763 | .proc_handler = proc_dointvec | 611 | .proc_handler = proc_dointvec |
764 | }, | 612 | }, |
765 | { | 613 | { |
766 | .ctl_name = NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, | ||
767 | .procname = "icmp_ignore_bogus_error_responses", | 614 | .procname = "icmp_ignore_bogus_error_responses", |
768 | .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses, | 615 | .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses, |
769 | .maxlen = sizeof(int), | 616 | .maxlen = sizeof(int), |
@@ -771,7 +618,6 @@ static struct ctl_table ipv4_net_table[] = { | |||
771 | .proc_handler = proc_dointvec | 618 | .proc_handler = proc_dointvec |
772 | }, | 619 | }, |
773 | { | 620 | { |
774 | .ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, | ||
775 | .procname = "icmp_errors_use_inbound_ifaddr", | 621 | .procname = "icmp_errors_use_inbound_ifaddr", |
776 | .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr, | 622 | .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr, |
777 | .maxlen = sizeof(int), | 623 | .maxlen = sizeof(int), |
@@ -779,16 +625,13 @@ static struct ctl_table ipv4_net_table[] = { | |||
779 | .proc_handler = proc_dointvec | 625 | .proc_handler = proc_dointvec |
780 | }, | 626 | }, |
781 | { | 627 | { |
782 | .ctl_name = NET_IPV4_ICMP_RATELIMIT, | ||
783 | .procname = "icmp_ratelimit", | 628 | .procname = "icmp_ratelimit", |
784 | .data = &init_net.ipv4.sysctl_icmp_ratelimit, | 629 | .data = &init_net.ipv4.sysctl_icmp_ratelimit, |
785 | .maxlen = sizeof(int), | 630 | .maxlen = sizeof(int), |
786 | .mode = 0644, | 631 | .mode = 0644, |
787 | .proc_handler = proc_dointvec_ms_jiffies, | 632 | .proc_handler = proc_dointvec_ms_jiffies, |
788 | .strategy = sysctl_ms_jiffies | ||
789 | }, | 633 | }, |
790 | { | 634 | { |
791 | .ctl_name = NET_IPV4_ICMP_RATEMASK, | ||
792 | .procname = "icmp_ratemask", | 635 | .procname = "icmp_ratemask", |
793 | .data = &init_net.ipv4.sysctl_icmp_ratemask, | 636 | .data = &init_net.ipv4.sysctl_icmp_ratemask, |
794 | .maxlen = sizeof(int), | 637 | .maxlen = sizeof(int), |
@@ -796,7 +639,6 @@ static struct ctl_table ipv4_net_table[] = { | |||
796 | .proc_handler = proc_dointvec | 639 | .proc_handler = proc_dointvec |
797 | }, | 640 | }, |
798 | { | 641 | { |
799 | .ctl_name = CTL_UNNUMBERED, | ||
800 | .procname = "rt_cache_rebuild_count", | 642 | .procname = "rt_cache_rebuild_count", |
801 | .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count, | 643 | .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count, |
802 | .maxlen = sizeof(int), | 644 | .maxlen = sizeof(int), |
@@ -807,8 +649,8 @@ static struct ctl_table ipv4_net_table[] = { | |||
807 | }; | 649 | }; |
808 | 650 | ||
809 | struct ctl_path net_ipv4_ctl_path[] = { | 651 | struct ctl_path net_ipv4_ctl_path[] = { |
810 | { .procname = "net", .ctl_name = CTL_NET, }, | 652 | { .procname = "net", }, |
811 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 653 | { .procname = "ipv4", }, |
812 | { }, | 654 | { }, |
813 | }; | 655 | }; |
814 | EXPORT_SYMBOL_GPL(net_ipv4_ctl_path); | 656 | EXPORT_SYMBOL_GPL(net_ipv4_ctl_path); |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 74fb2eb833ec..8c08a28d8f83 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
@@ -267,7 +267,6 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { | |||
267 | #ifdef CONFIG_SYSCTL | 267 | #ifdef CONFIG_SYSCTL |
268 | static struct ctl_table xfrm4_policy_table[] = { | 268 | static struct ctl_table xfrm4_policy_table[] = { |
269 | { | 269 | { |
270 | .ctl_name = CTL_UNNUMBERED, | ||
271 | .procname = "xfrm4_gc_thresh", | 270 | .procname = "xfrm4_gc_thresh", |
272 | .data = &xfrm4_dst_ops.gc_thresh, | 271 | .data = &xfrm4_dst_ops.gc_thresh, |
273 | .maxlen = sizeof(int), | 272 | .maxlen = sizeof(int), |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1fd0a3d775d2..f918399c985c 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -4000,41 +4000,6 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, | |||
4000 | return ret; | 4000 | return ret; |
4001 | } | 4001 | } |
4002 | 4002 | ||
4003 | static int addrconf_sysctl_forward_strategy(ctl_table *table, | ||
4004 | void __user *oldval, | ||
4005 | size_t __user *oldlenp, | ||
4006 | void __user *newval, size_t newlen) | ||
4007 | { | ||
4008 | int *valp = table->data; | ||
4009 | int val = *valp; | ||
4010 | int new; | ||
4011 | |||
4012 | if (!newval || !newlen) | ||
4013 | return 0; | ||
4014 | if (newlen != sizeof(int)) | ||
4015 | return -EINVAL; | ||
4016 | if (get_user(new, (int __user *)newval)) | ||
4017 | return -EFAULT; | ||
4018 | if (new == *valp) | ||
4019 | return 0; | ||
4020 | if (oldval && oldlenp) { | ||
4021 | size_t len; | ||
4022 | if (get_user(len, oldlenp)) | ||
4023 | return -EFAULT; | ||
4024 | if (len) { | ||
4025 | if (len > table->maxlen) | ||
4026 | len = table->maxlen; | ||
4027 | if (copy_to_user(oldval, valp, len)) | ||
4028 | return -EFAULT; | ||
4029 | if (put_user(len, oldlenp)) | ||
4030 | return -EFAULT; | ||
4031 | } | ||
4032 | } | ||
4033 | |||
4034 | *valp = new; | ||
4035 | return addrconf_fixup_forwarding(table, valp, val); | ||
4036 | } | ||
4037 | |||
4038 | static void dev_disable_change(struct inet6_dev *idev) | 4003 | static void dev_disable_change(struct inet6_dev *idev) |
4039 | { | 4004 | { |
4040 | if (!idev || !idev->dev) | 4005 | if (!idev || !idev->dev) |
@@ -4113,16 +4078,13 @@ static struct addrconf_sysctl_table | |||
4113 | .sysctl_header = NULL, | 4078 | .sysctl_header = NULL, |
4114 | .addrconf_vars = { | 4079 | .addrconf_vars = { |
4115 | { | 4080 | { |
4116 | .ctl_name = NET_IPV6_FORWARDING, | ||
4117 | .procname = "forwarding", | 4081 | .procname = "forwarding", |
4118 | .data = &ipv6_devconf.forwarding, | 4082 | .data = &ipv6_devconf.forwarding, |
4119 | .maxlen = sizeof(int), | 4083 | .maxlen = sizeof(int), |
4120 | .mode = 0644, | 4084 | .mode = 0644, |
4121 | .proc_handler = addrconf_sysctl_forward, | 4085 | .proc_handler = addrconf_sysctl_forward, |
4122 | .strategy = addrconf_sysctl_forward_strategy, | ||
4123 | }, | 4086 | }, |
4124 | { | 4087 | { |
4125 | .ctl_name = NET_IPV6_HOP_LIMIT, | ||
4126 | .procname = "hop_limit", | 4088 | .procname = "hop_limit", |
4127 | .data = &ipv6_devconf.hop_limit, | 4089 | .data = &ipv6_devconf.hop_limit, |
4128 | .maxlen = sizeof(int), | 4090 | .maxlen = sizeof(int), |
@@ -4130,7 +4092,6 @@ static struct addrconf_sysctl_table | |||
4130 | .proc_handler = proc_dointvec, | 4092 | .proc_handler = proc_dointvec, |
4131 | }, | 4093 | }, |
4132 | { | 4094 | { |
4133 | .ctl_name = NET_IPV6_MTU, | ||
4134 | .procname = "mtu", | 4095 | .procname = "mtu", |
4135 | .data = &ipv6_devconf.mtu6, | 4096 | .data = &ipv6_devconf.mtu6, |
4136 | .maxlen = sizeof(int), | 4097 | .maxlen = sizeof(int), |
@@ -4138,7 +4099,6 @@ static struct addrconf_sysctl_table | |||
4138 | .proc_handler = proc_dointvec, | 4099 | .proc_handler = proc_dointvec, |
4139 | }, | 4100 | }, |
4140 | { | 4101 | { |
4141 | .ctl_name = NET_IPV6_ACCEPT_RA, | ||
4142 | .procname = "accept_ra", | 4102 | .procname = "accept_ra", |
4143 | .data = &ipv6_devconf.accept_ra, | 4103 | .data = &ipv6_devconf.accept_ra, |
4144 | .maxlen = sizeof(int), | 4104 | .maxlen = sizeof(int), |
@@ -4146,7 +4106,6 @@ static struct addrconf_sysctl_table | |||
4146 | .proc_handler = proc_dointvec, | 4106 | .proc_handler = proc_dointvec, |
4147 | }, | 4107 | }, |
4148 | { | 4108 | { |
4149 | .ctl_name = NET_IPV6_ACCEPT_REDIRECTS, | ||
4150 | .procname = "accept_redirects", | 4109 | .procname = "accept_redirects", |
4151 | .data = &ipv6_devconf.accept_redirects, | 4110 | .data = &ipv6_devconf.accept_redirects, |
4152 | .maxlen = sizeof(int), | 4111 | .maxlen = sizeof(int), |
@@ -4154,7 +4113,6 @@ static struct addrconf_sysctl_table | |||
4154 | .proc_handler = proc_dointvec, | 4113 | .proc_handler = proc_dointvec, |
4155 | }, | 4114 | }, |
4156 | { | 4115 | { |
4157 | .ctl_name = NET_IPV6_AUTOCONF, | ||
4158 | .procname = "autoconf", | 4116 | .procname = "autoconf", |
4159 | .data = &ipv6_devconf.autoconf, | 4117 | .data = &ipv6_devconf.autoconf, |
4160 | .maxlen = sizeof(int), | 4118 | .maxlen = sizeof(int), |
@@ -4162,7 +4120,6 @@ static struct addrconf_sysctl_table | |||
4162 | .proc_handler = proc_dointvec, | 4120 | .proc_handler = proc_dointvec, |
4163 | }, | 4121 | }, |
4164 | { | 4122 | { |
4165 | .ctl_name = NET_IPV6_DAD_TRANSMITS, | ||
4166 | .procname = "dad_transmits", | 4123 | .procname = "dad_transmits", |
4167 | .data = &ipv6_devconf.dad_transmits, | 4124 | .data = &ipv6_devconf.dad_transmits, |
4168 | .maxlen = sizeof(int), | 4125 | .maxlen = sizeof(int), |
@@ -4170,7 +4127,6 @@ static struct addrconf_sysctl_table | |||
4170 | .proc_handler = proc_dointvec, | 4127 | .proc_handler = proc_dointvec, |
4171 | }, | 4128 | }, |
4172 | { | 4129 | { |
4173 | .ctl_name = NET_IPV6_RTR_SOLICITS, | ||
4174 | .procname = "router_solicitations", | 4130 | .procname = "router_solicitations", |
4175 | .data = &ipv6_devconf.rtr_solicits, | 4131 | .data = &ipv6_devconf.rtr_solicits, |
4176 | .maxlen = sizeof(int), | 4132 | .maxlen = sizeof(int), |
@@ -4178,25 +4134,20 @@ static struct addrconf_sysctl_table | |||
4178 | .proc_handler = proc_dointvec, | 4134 | .proc_handler = proc_dointvec, |
4179 | }, | 4135 | }, |
4180 | { | 4136 | { |
4181 | .ctl_name = NET_IPV6_RTR_SOLICIT_INTERVAL, | ||
4182 | .procname = "router_solicitation_interval", | 4137 | .procname = "router_solicitation_interval", |
4183 | .data = &ipv6_devconf.rtr_solicit_interval, | 4138 | .data = &ipv6_devconf.rtr_solicit_interval, |
4184 | .maxlen = sizeof(int), | 4139 | .maxlen = sizeof(int), |
4185 | .mode = 0644, | 4140 | .mode = 0644, |
4186 | .proc_handler = proc_dointvec_jiffies, | 4141 | .proc_handler = proc_dointvec_jiffies, |
4187 | .strategy = sysctl_jiffies, | ||
4188 | }, | 4142 | }, |
4189 | { | 4143 | { |
4190 | .ctl_name = NET_IPV6_RTR_SOLICIT_DELAY, | ||
4191 | .procname = "router_solicitation_delay", | 4144 | .procname = "router_solicitation_delay", |
4192 | .data = &ipv6_devconf.rtr_solicit_delay, | 4145 | .data = &ipv6_devconf.rtr_solicit_delay, |
4193 | .maxlen = sizeof(int), | 4146 | .maxlen = sizeof(int), |
4194 | .mode = 0644, | 4147 | .mode = 0644, |
4195 | .proc_handler = proc_dointvec_jiffies, | 4148 | .proc_handler = proc_dointvec_jiffies, |
4196 | .strategy = sysctl_jiffies, | ||
4197 | }, | 4149 | }, |
4198 | { | 4150 | { |
4199 | .ctl_name = NET_IPV6_FORCE_MLD_VERSION, | ||
4200 | .procname = "force_mld_version", | 4151 | .procname = "force_mld_version", |
4201 | .data = &ipv6_devconf.force_mld_version, | 4152 | .data = &ipv6_devconf.force_mld_version, |
4202 | .maxlen = sizeof(int), | 4153 | .maxlen = sizeof(int), |
@@ -4205,7 +4156,6 @@ static struct addrconf_sysctl_table | |||
4205 | }, | 4156 | }, |
4206 | #ifdef CONFIG_IPV6_PRIVACY | 4157 | #ifdef CONFIG_IPV6_PRIVACY |
4207 | { | 4158 | { |
4208 | .ctl_name = NET_IPV6_USE_TEMPADDR, | ||
4209 | .procname = "use_tempaddr", | 4159 | .procname = "use_tempaddr", |
4210 | .data = &ipv6_devconf.use_tempaddr, | 4160 | .data = &ipv6_devconf.use_tempaddr, |
4211 | .maxlen = sizeof(int), | 4161 | .maxlen = sizeof(int), |
@@ -4213,7 +4163,6 @@ static struct addrconf_sysctl_table | |||
4213 | .proc_handler = proc_dointvec, | 4163 | .proc_handler = proc_dointvec, |
4214 | }, | 4164 | }, |
4215 | { | 4165 | { |
4216 | .ctl_name = NET_IPV6_TEMP_VALID_LFT, | ||
4217 | .procname = "temp_valid_lft", | 4166 | .procname = "temp_valid_lft", |
4218 | .data = &ipv6_devconf.temp_valid_lft, | 4167 | .data = &ipv6_devconf.temp_valid_lft, |
4219 | .maxlen = sizeof(int), | 4168 | .maxlen = sizeof(int), |
@@ -4221,7 +4170,6 @@ static struct addrconf_sysctl_table | |||
4221 | .proc_handler = proc_dointvec, | 4170 | .proc_handler = proc_dointvec, |
4222 | }, | 4171 | }, |
4223 | { | 4172 | { |
4224 | .ctl_name = NET_IPV6_TEMP_PREFERED_LFT, | ||
4225 | .procname = "temp_prefered_lft", | 4173 | .procname = "temp_prefered_lft", |
4226 | .data = &ipv6_devconf.temp_prefered_lft, | 4174 | .data = &ipv6_devconf.temp_prefered_lft, |
4227 | .maxlen = sizeof(int), | 4175 | .maxlen = sizeof(int), |
@@ -4229,7 +4177,6 @@ static struct addrconf_sysctl_table | |||
4229 | .proc_handler = proc_dointvec, | 4177 | .proc_handler = proc_dointvec, |
4230 | }, | 4178 | }, |
4231 | { | 4179 | { |
4232 | .ctl_name = NET_IPV6_REGEN_MAX_RETRY, | ||
4233 | .procname = "regen_max_retry", | 4180 | .procname = "regen_max_retry", |
4234 | .data = &ipv6_devconf.regen_max_retry, | 4181 | .data = &ipv6_devconf.regen_max_retry, |
4235 | .maxlen = sizeof(int), | 4182 | .maxlen = sizeof(int), |
@@ -4237,7 +4184,6 @@ static struct addrconf_sysctl_table | |||
4237 | .proc_handler = proc_dointvec, | 4184 | .proc_handler = proc_dointvec, |
4238 | }, | 4185 | }, |
4239 | { | 4186 | { |
4240 | .ctl_name = NET_IPV6_MAX_DESYNC_FACTOR, | ||
4241 | .procname = "max_desync_factor", | 4187 | .procname = "max_desync_factor", |
4242 | .data = &ipv6_devconf.max_desync_factor, | 4188 | .data = &ipv6_devconf.max_desync_factor, |
4243 | .maxlen = sizeof(int), | 4189 | .maxlen = sizeof(int), |
@@ -4246,7 +4192,6 @@ static struct addrconf_sysctl_table | |||
4246 | }, | 4192 | }, |
4247 | #endif | 4193 | #endif |
4248 | { | 4194 | { |
4249 | .ctl_name = NET_IPV6_MAX_ADDRESSES, | ||
4250 | .procname = "max_addresses", | 4195 | .procname = "max_addresses", |
4251 | .data = &ipv6_devconf.max_addresses, | 4196 | .data = &ipv6_devconf.max_addresses, |
4252 | .maxlen = sizeof(int), | 4197 | .maxlen = sizeof(int), |
@@ -4254,7 +4199,6 @@ static struct addrconf_sysctl_table | |||
4254 | .proc_handler = proc_dointvec, | 4199 | .proc_handler = proc_dointvec, |
4255 | }, | 4200 | }, |
4256 | { | 4201 | { |
4257 | .ctl_name = NET_IPV6_ACCEPT_RA_DEFRTR, | ||
4258 | .procname = "accept_ra_defrtr", | 4202 | .procname = "accept_ra_defrtr", |
4259 | .data = &ipv6_devconf.accept_ra_defrtr, | 4203 | .data = &ipv6_devconf.accept_ra_defrtr, |
4260 | .maxlen = sizeof(int), | 4204 | .maxlen = sizeof(int), |
@@ -4262,7 +4206,6 @@ static struct addrconf_sysctl_table | |||
4262 | .proc_handler = proc_dointvec, | 4206 | .proc_handler = proc_dointvec, |
4263 | }, | 4207 | }, |
4264 | { | 4208 | { |
4265 | .ctl_name = NET_IPV6_ACCEPT_RA_PINFO, | ||
4266 | .procname = "accept_ra_pinfo", | 4209 | .procname = "accept_ra_pinfo", |
4267 | .data = &ipv6_devconf.accept_ra_pinfo, | 4210 | .data = &ipv6_devconf.accept_ra_pinfo, |
4268 | .maxlen = sizeof(int), | 4211 | .maxlen = sizeof(int), |
@@ -4271,7 +4214,6 @@ static struct addrconf_sysctl_table | |||
4271 | }, | 4214 | }, |
4272 | #ifdef CONFIG_IPV6_ROUTER_PREF | 4215 | #ifdef CONFIG_IPV6_ROUTER_PREF |
4273 | { | 4216 | { |
4274 | .ctl_name = NET_IPV6_ACCEPT_RA_RTR_PREF, | ||
4275 | .procname = "accept_ra_rtr_pref", | 4217 | .procname = "accept_ra_rtr_pref", |
4276 | .data = &ipv6_devconf.accept_ra_rtr_pref, | 4218 | .data = &ipv6_devconf.accept_ra_rtr_pref, |
4277 | .maxlen = sizeof(int), | 4219 | .maxlen = sizeof(int), |
@@ -4279,17 +4221,14 @@ static struct addrconf_sysctl_table | |||
4279 | .proc_handler = proc_dointvec, | 4221 | .proc_handler = proc_dointvec, |
4280 | }, | 4222 | }, |
4281 | { | 4223 | { |
4282 | .ctl_name = NET_IPV6_RTR_PROBE_INTERVAL, | ||
4283 | .procname = "router_probe_interval", | 4224 | .procname = "router_probe_interval", |
4284 | .data = &ipv6_devconf.rtr_probe_interval, | 4225 | .data = &ipv6_devconf.rtr_probe_interval, |
4285 | .maxlen = sizeof(int), | 4226 | .maxlen = sizeof(int), |
4286 | .mode = 0644, | 4227 | .mode = 0644, |
4287 | .proc_handler = proc_dointvec_jiffies, | 4228 | .proc_handler = proc_dointvec_jiffies, |
4288 | .strategy = sysctl_jiffies, | ||
4289 | }, | 4229 | }, |
4290 | #ifdef CONFIG_IPV6_ROUTE_INFO | 4230 | #ifdef CONFIG_IPV6_ROUTE_INFO |
4291 | { | 4231 | { |
4292 | .ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, | ||
4293 | .procname = "accept_ra_rt_info_max_plen", | 4232 | .procname = "accept_ra_rt_info_max_plen", |
4294 | .data = &ipv6_devconf.accept_ra_rt_info_max_plen, | 4233 | .data = &ipv6_devconf.accept_ra_rt_info_max_plen, |
4295 | .maxlen = sizeof(int), | 4234 | .maxlen = sizeof(int), |
@@ -4299,7 +4238,6 @@ static struct addrconf_sysctl_table | |||
4299 | #endif | 4238 | #endif |
4300 | #endif | 4239 | #endif |
4301 | { | 4240 | { |
4302 | .ctl_name = NET_IPV6_PROXY_NDP, | ||
4303 | .procname = "proxy_ndp", | 4241 | .procname = "proxy_ndp", |
4304 | .data = &ipv6_devconf.proxy_ndp, | 4242 | .data = &ipv6_devconf.proxy_ndp, |
4305 | .maxlen = sizeof(int), | 4243 | .maxlen = sizeof(int), |
@@ -4307,7 +4245,6 @@ static struct addrconf_sysctl_table | |||
4307 | .proc_handler = proc_dointvec, | 4245 | .proc_handler = proc_dointvec, |
4308 | }, | 4246 | }, |
4309 | { | 4247 | { |
4310 | .ctl_name = NET_IPV6_ACCEPT_SOURCE_ROUTE, | ||
4311 | .procname = "accept_source_route", | 4248 | .procname = "accept_source_route", |
4312 | .data = &ipv6_devconf.accept_source_route, | 4249 | .data = &ipv6_devconf.accept_source_route, |
4313 | .maxlen = sizeof(int), | 4250 | .maxlen = sizeof(int), |
@@ -4316,7 +4253,6 @@ static struct addrconf_sysctl_table | |||
4316 | }, | 4253 | }, |
4317 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD | 4254 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD |
4318 | { | 4255 | { |
4319 | .ctl_name = CTL_UNNUMBERED, | ||
4320 | .procname = "optimistic_dad", | 4256 | .procname = "optimistic_dad", |
4321 | .data = &ipv6_devconf.optimistic_dad, | 4257 | .data = &ipv6_devconf.optimistic_dad, |
4322 | .maxlen = sizeof(int), | 4258 | .maxlen = sizeof(int), |
@@ -4327,7 +4263,6 @@ static struct addrconf_sysctl_table | |||
4327 | #endif | 4263 | #endif |
4328 | #ifdef CONFIG_IPV6_MROUTE | 4264 | #ifdef CONFIG_IPV6_MROUTE |
4329 | { | 4265 | { |
4330 | .ctl_name = CTL_UNNUMBERED, | ||
4331 | .procname = "mc_forwarding", | 4266 | .procname = "mc_forwarding", |
4332 | .data = &ipv6_devconf.mc_forwarding, | 4267 | .data = &ipv6_devconf.mc_forwarding, |
4333 | .maxlen = sizeof(int), | 4268 | .maxlen = sizeof(int), |
@@ -4336,16 +4271,13 @@ static struct addrconf_sysctl_table | |||
4336 | }, | 4271 | }, |
4337 | #endif | 4272 | #endif |
4338 | { | 4273 | { |
4339 | .ctl_name = CTL_UNNUMBERED, | ||
4340 | .procname = "disable_ipv6", | 4274 | .procname = "disable_ipv6", |
4341 | .data = &ipv6_devconf.disable_ipv6, | 4275 | .data = &ipv6_devconf.disable_ipv6, |
4342 | .maxlen = sizeof(int), | 4276 | .maxlen = sizeof(int), |
4343 | .mode = 0644, | 4277 | .mode = 0644, |
4344 | .proc_handler = addrconf_sysctl_disable, | 4278 | .proc_handler = addrconf_sysctl_disable, |
4345 | .strategy = sysctl_intvec, | ||
4346 | }, | 4279 | }, |
4347 | { | 4280 | { |
4348 | .ctl_name = CTL_UNNUMBERED, | ||
4349 | .procname = "accept_dad", | 4281 | .procname = "accept_dad", |
4350 | .data = &ipv6_devconf.accept_dad, | 4282 | .data = &ipv6_devconf.accept_dad, |
4351 | .maxlen = sizeof(int), | 4283 | .maxlen = sizeof(int), |
@@ -4353,13 +4285,13 @@ static struct addrconf_sysctl_table | |||
4353 | .proc_handler = proc_dointvec, | 4285 | .proc_handler = proc_dointvec, |
4354 | }, | 4286 | }, |
4355 | { | 4287 | { |
4356 | .ctl_name = 0, /* sentinel */ | 4288 | /* sentinel */ |
4357 | } | 4289 | } |
4358 | }, | 4290 | }, |
4359 | }; | 4291 | }; |
4360 | 4292 | ||
4361 | static int __addrconf_sysctl_register(struct net *net, char *dev_name, | 4293 | static int __addrconf_sysctl_register(struct net *net, char *dev_name, |
4362 | int ctl_name, struct inet6_dev *idev, struct ipv6_devconf *p) | 4294 | struct inet6_dev *idev, struct ipv6_devconf *p) |
4363 | { | 4295 | { |
4364 | int i; | 4296 | int i; |
4365 | struct addrconf_sysctl_table *t; | 4297 | struct addrconf_sysctl_table *t; |
@@ -4367,9 +4299,9 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name, | |||
4367 | #define ADDRCONF_CTL_PATH_DEV 3 | 4299 | #define ADDRCONF_CTL_PATH_DEV 3 |
4368 | 4300 | ||
4369 | struct ctl_path addrconf_ctl_path[] = { | 4301 | struct ctl_path addrconf_ctl_path[] = { |
4370 | { .procname = "net", .ctl_name = CTL_NET, }, | 4302 | { .procname = "net", }, |
4371 | { .procname = "ipv6", .ctl_name = NET_IPV6, }, | 4303 | { .procname = "ipv6", }, |
4372 | { .procname = "conf", .ctl_name = NET_IPV6_CONF, }, | 4304 | { .procname = "conf", }, |
4373 | { /* to be set */ }, | 4305 | { /* to be set */ }, |
4374 | { }, | 4306 | { }, |
4375 | }; | 4307 | }; |
@@ -4395,7 +4327,6 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name, | |||
4395 | goto free; | 4327 | goto free; |
4396 | 4328 | ||
4397 | addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].procname = t->dev_name; | 4329 | addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].procname = t->dev_name; |
4398 | addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].ctl_name = ctl_name; | ||
4399 | 4330 | ||
4400 | t->sysctl_header = register_net_sysctl_table(net, addrconf_ctl_path, | 4331 | t->sysctl_header = register_net_sysctl_table(net, addrconf_ctl_path, |
4401 | t->addrconf_vars); | 4332 | t->addrconf_vars); |
@@ -4431,10 +4362,9 @@ static void addrconf_sysctl_register(struct inet6_dev *idev) | |||
4431 | { | 4362 | { |
4432 | neigh_sysctl_register(idev->dev, idev->nd_parms, NET_IPV6, | 4363 | neigh_sysctl_register(idev->dev, idev->nd_parms, NET_IPV6, |
4433 | NET_IPV6_NEIGH, "ipv6", | 4364 | NET_IPV6_NEIGH, "ipv6", |
4434 | &ndisc_ifinfo_sysctl_change, | 4365 | &ndisc_ifinfo_sysctl_change); |
4435 | ndisc_ifinfo_sysctl_strategy); | ||
4436 | __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name, | 4366 | __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name, |
4437 | idev->dev->ifindex, idev, &idev->cnf); | 4367 | idev, &idev->cnf); |
4438 | } | 4368 | } |
4439 | 4369 | ||
4440 | static void addrconf_sysctl_unregister(struct inet6_dev *idev) | 4370 | static void addrconf_sysctl_unregister(struct inet6_dev *idev) |
@@ -4473,13 +4403,11 @@ static int addrconf_init_net(struct net *net) | |||
4473 | net->ipv6.devconf_dflt = dflt; | 4403 | net->ipv6.devconf_dflt = dflt; |
4474 | 4404 | ||
4475 | #ifdef CONFIG_SYSCTL | 4405 | #ifdef CONFIG_SYSCTL |
4476 | err = __addrconf_sysctl_register(net, "all", NET_PROTO_CONF_ALL, | 4406 | err = __addrconf_sysctl_register(net, "all", NULL, all); |
4477 | NULL, all); | ||
4478 | if (err < 0) | 4407 | if (err < 0) |
4479 | goto err_reg_all; | 4408 | goto err_reg_all; |
4480 | 4409 | ||
4481 | err = __addrconf_sysctl_register(net, "default", NET_PROTO_CONF_DEFAULT, | 4410 | err = __addrconf_sysctl_register(net, "default", NULL, dflt); |
4482 | NULL, dflt); | ||
4483 | if (err < 0) | 4411 | if (err < 0) |
4484 | goto err_reg_dflt; | 4412 | goto err_reg_dflt; |
4485 | #endif | 4413 | #endif |
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index f23ebbec0631..4ae661bc3677 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -942,15 +942,13 @@ EXPORT_SYMBOL(icmpv6_err_convert); | |||
942 | #ifdef CONFIG_SYSCTL | 942 | #ifdef CONFIG_SYSCTL |
943 | ctl_table ipv6_icmp_table_template[] = { | 943 | ctl_table ipv6_icmp_table_template[] = { |
944 | { | 944 | { |
945 | .ctl_name = NET_IPV6_ICMP_RATELIMIT, | ||
946 | .procname = "ratelimit", | 945 | .procname = "ratelimit", |
947 | .data = &init_net.ipv6.sysctl.icmpv6_time, | 946 | .data = &init_net.ipv6.sysctl.icmpv6_time, |
948 | .maxlen = sizeof(int), | 947 | .maxlen = sizeof(int), |
949 | .mode = 0644, | 948 | .mode = 0644, |
950 | .proc_handler = proc_dointvec_ms_jiffies, | 949 | .proc_handler = proc_dointvec_ms_jiffies, |
951 | .strategy = sysctl_ms_jiffies | ||
952 | }, | 950 | }, |
953 | { .ctl_name = 0 }, | 951 | { }, |
954 | }; | 952 | }; |
955 | 953 | ||
956 | struct ctl_table *ipv6_icmp_sysctl_init(struct net *net) | 954 | struct ctl_table *ipv6_icmp_sysctl_init(struct net *net) |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index f74e4e2cdd06..3d0520e455d8 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1768,42 +1768,6 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void __user *bu | |||
1768 | return ret; | 1768 | return ret; |
1769 | } | 1769 | } |
1770 | 1770 | ||
1771 | int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, | ||
1772 | void __user *oldval, size_t __user *oldlenp, | ||
1773 | void __user *newval, size_t newlen) | ||
1774 | { | ||
1775 | struct net_device *dev = ctl->extra1; | ||
1776 | struct inet6_dev *idev; | ||
1777 | int ret; | ||
1778 | |||
1779 | if (ctl->ctl_name == NET_NEIGH_RETRANS_TIME || | ||
1780 | ctl->ctl_name == NET_NEIGH_REACHABLE_TIME) | ||
1781 | ndisc_warn_deprecated_sysctl(ctl, "procfs", dev ? dev->name : "default"); | ||
1782 | |||
1783 | switch (ctl->ctl_name) { | ||
1784 | case NET_NEIGH_REACHABLE_TIME: | ||
1785 | ret = sysctl_jiffies(ctl, oldval, oldlenp, newval, newlen); | ||
1786 | break; | ||
1787 | case NET_NEIGH_RETRANS_TIME_MS: | ||
1788 | case NET_NEIGH_REACHABLE_TIME_MS: | ||
1789 | ret = sysctl_ms_jiffies(ctl, oldval, oldlenp, newval, newlen); | ||
1790 | break; | ||
1791 | default: | ||
1792 | ret = 0; | ||
1793 | } | ||
1794 | |||
1795 | if (newval && newlen && ret > 0 && | ||
1796 | dev && (idev = in6_dev_get(dev)) != NULL) { | ||
1797 | if (ctl->ctl_name == NET_NEIGH_REACHABLE_TIME || | ||
1798 | ctl->ctl_name == NET_NEIGH_REACHABLE_TIME_MS) | ||
1799 | idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time); | ||
1800 | idev->tstamp = jiffies; | ||
1801 | inet6_ifinfo_notify(RTM_NEWLINK, idev); | ||
1802 | in6_dev_put(idev); | ||
1803 | } | ||
1804 | |||
1805 | return ret; | ||
1806 | } | ||
1807 | 1771 | ||
1808 | #endif | 1772 | #endif |
1809 | 1773 | ||
@@ -1857,8 +1821,7 @@ int __init ndisc_init(void) | |||
1857 | #ifdef CONFIG_SYSCTL | 1821 | #ifdef CONFIG_SYSCTL |
1858 | err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, | 1822 | err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, |
1859 | NET_IPV6_NEIGH, "ipv6", | 1823 | NET_IPV6_NEIGH, "ipv6", |
1860 | &ndisc_ifinfo_sysctl_change, | 1824 | &ndisc_ifinfo_sysctl_change); |
1861 | &ndisc_ifinfo_sysctl_strategy); | ||
1862 | if (err) | 1825 | if (err) |
1863 | goto out_unregister_pernet; | 1826 | goto out_unregister_pernet; |
1864 | #endif | 1827 | #endif |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index 1cf3f0c6a959..14e52aa624c2 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -36,7 +36,6 @@ | |||
36 | 36 | ||
37 | #define IPQ_QMAX_DEFAULT 1024 | 37 | #define IPQ_QMAX_DEFAULT 1024 |
38 | #define IPQ_PROC_FS_NAME "ip6_queue" | 38 | #define IPQ_PROC_FS_NAME "ip6_queue" |
39 | #define NET_IPQ_QMAX 2088 | ||
40 | #define NET_IPQ_QMAX_NAME "ip6_queue_maxlen" | 39 | #define NET_IPQ_QMAX_NAME "ip6_queue_maxlen" |
41 | 40 | ||
42 | typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long); | 41 | typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long); |
@@ -518,14 +517,13 @@ static struct ctl_table_header *ipq_sysctl_header; | |||
518 | 517 | ||
519 | static ctl_table ipq_table[] = { | 518 | static ctl_table ipq_table[] = { |
520 | { | 519 | { |
521 | .ctl_name = NET_IPQ_QMAX, | ||
522 | .procname = NET_IPQ_QMAX_NAME, | 520 | .procname = NET_IPQ_QMAX_NAME, |
523 | .data = &queue_maxlen, | 521 | .data = &queue_maxlen, |
524 | .maxlen = sizeof(queue_maxlen), | 522 | .maxlen = sizeof(queue_maxlen), |
525 | .mode = 0644, | 523 | .mode = 0644, |
526 | .proc_handler = proc_dointvec | 524 | .proc_handler = proc_dointvec |
527 | }, | 525 | }, |
528 | { .ctl_name = 0 } | 526 | { } |
529 | }; | 527 | }; |
530 | #endif | 528 | #endif |
531 | 529 | ||
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index 642dcb127bab..2acadc8c7883 100644 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | |||
@@ -277,9 +277,7 @@ static struct ctl_table icmpv6_sysctl_table[] = { | |||
277 | .mode = 0644, | 277 | .mode = 0644, |
278 | .proc_handler = proc_dointvec_jiffies, | 278 | .proc_handler = proc_dointvec_jiffies, |
279 | }, | 279 | }, |
280 | { | 280 | { } |
281 | .ctl_name = 0 | ||
282 | } | ||
283 | }; | 281 | }; |
284 | #endif /* CONFIG_SYSCTL */ | 282 | #endif /* CONFIG_SYSCTL */ |
285 | 283 | ||
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index f3aba255ad9f..e0b9424fa1b2 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -83,7 +83,6 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = { | |||
83 | .proc_handler = proc_dointvec_jiffies, | 83 | .proc_handler = proc_dointvec_jiffies, |
84 | }, | 84 | }, |
85 | { | 85 | { |
86 | .ctl_name = NET_NF_CONNTRACK_FRAG6_LOW_THRESH, | ||
87 | .procname = "nf_conntrack_frag6_low_thresh", | 86 | .procname = "nf_conntrack_frag6_low_thresh", |
88 | .data = &nf_init_frags.low_thresh, | 87 | .data = &nf_init_frags.low_thresh, |
89 | .maxlen = sizeof(unsigned int), | 88 | .maxlen = sizeof(unsigned int), |
@@ -91,14 +90,13 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = { | |||
91 | .proc_handler = proc_dointvec, | 90 | .proc_handler = proc_dointvec, |
92 | }, | 91 | }, |
93 | { | 92 | { |
94 | .ctl_name = NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, | ||
95 | .procname = "nf_conntrack_frag6_high_thresh", | 93 | .procname = "nf_conntrack_frag6_high_thresh", |
96 | .data = &nf_init_frags.high_thresh, | 94 | .data = &nf_init_frags.high_thresh, |
97 | .maxlen = sizeof(unsigned int), | 95 | .maxlen = sizeof(unsigned int), |
98 | .mode = 0644, | 96 | .mode = 0644, |
99 | .proc_handler = proc_dointvec, | 97 | .proc_handler = proc_dointvec, |
100 | }, | 98 | }, |
101 | { .ctl_name = 0 } | 99 | { } |
102 | }; | 100 | }; |
103 | #endif | 101 | #endif |
104 | 102 | ||
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index da5bd0ed83df..2499e9712031 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -636,7 +636,6 @@ static const struct inet6_protocol frag_protocol = | |||
636 | #ifdef CONFIG_SYSCTL | 636 | #ifdef CONFIG_SYSCTL |
637 | static struct ctl_table ip6_frags_ns_ctl_table[] = { | 637 | static struct ctl_table ip6_frags_ns_ctl_table[] = { |
638 | { | 638 | { |
639 | .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH, | ||
640 | .procname = "ip6frag_high_thresh", | 639 | .procname = "ip6frag_high_thresh", |
641 | .data = &init_net.ipv6.frags.high_thresh, | 640 | .data = &init_net.ipv6.frags.high_thresh, |
642 | .maxlen = sizeof(int), | 641 | .maxlen = sizeof(int), |
@@ -644,7 +643,6 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = { | |||
644 | .proc_handler = proc_dointvec | 643 | .proc_handler = proc_dointvec |
645 | }, | 644 | }, |
646 | { | 645 | { |
647 | .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH, | ||
648 | .procname = "ip6frag_low_thresh", | 646 | .procname = "ip6frag_low_thresh", |
649 | .data = &init_net.ipv6.frags.low_thresh, | 647 | .data = &init_net.ipv6.frags.low_thresh, |
650 | .maxlen = sizeof(int), | 648 | .maxlen = sizeof(int), |
@@ -652,26 +650,22 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = { | |||
652 | .proc_handler = proc_dointvec | 650 | .proc_handler = proc_dointvec |
653 | }, | 651 | }, |
654 | { | 652 | { |
655 | .ctl_name = NET_IPV6_IP6FRAG_TIME, | ||
656 | .procname = "ip6frag_time", | 653 | .procname = "ip6frag_time", |
657 | .data = &init_net.ipv6.frags.timeout, | 654 | .data = &init_net.ipv6.frags.timeout, |
658 | .maxlen = sizeof(int), | 655 | .maxlen = sizeof(int), |
659 | .mode = 0644, | 656 | .mode = 0644, |
660 | .proc_handler = proc_dointvec_jiffies, | 657 | .proc_handler = proc_dointvec_jiffies, |
661 | .strategy = sysctl_jiffies, | ||
662 | }, | 658 | }, |
663 | { } | 659 | { } |
664 | }; | 660 | }; |
665 | 661 | ||
666 | static struct ctl_table ip6_frags_ctl_table[] = { | 662 | static struct ctl_table ip6_frags_ctl_table[] = { |
667 | { | 663 | { |
668 | .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL, | ||
669 | .procname = "ip6frag_secret_interval", | 664 | .procname = "ip6frag_secret_interval", |
670 | .data = &ip6_frags.secret_interval, | 665 | .data = &ip6_frags.secret_interval, |
671 | .maxlen = sizeof(int), | 666 | .maxlen = sizeof(int), |
672 | .mode = 0644, | 667 | .mode = 0644, |
673 | .proc_handler = proc_dointvec_jiffies, | 668 | .proc_handler = proc_dointvec_jiffies, |
674 | .strategy = sysctl_jiffies | ||
675 | }, | 669 | }, |
676 | { } | 670 | { } |
677 | }; | 671 | }; |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d6fe7646a8ff..6aa202e26f97 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2546,7 +2546,6 @@ ctl_table ipv6_route_table_template[] = { | |||
2546 | .proc_handler = ipv6_sysctl_rtcache_flush | 2546 | .proc_handler = ipv6_sysctl_rtcache_flush |
2547 | }, | 2547 | }, |
2548 | { | 2548 | { |
2549 | .ctl_name = NET_IPV6_ROUTE_GC_THRESH, | ||
2550 | .procname = "gc_thresh", | 2549 | .procname = "gc_thresh", |
2551 | .data = &ip6_dst_ops_template.gc_thresh, | 2550 | .data = &ip6_dst_ops_template.gc_thresh, |
2552 | .maxlen = sizeof(int), | 2551 | .maxlen = sizeof(int), |
@@ -2554,7 +2553,6 @@ ctl_table ipv6_route_table_template[] = { | |||
2554 | .proc_handler = proc_dointvec, | 2553 | .proc_handler = proc_dointvec, |
2555 | }, | 2554 | }, |
2556 | { | 2555 | { |
2557 | .ctl_name = NET_IPV6_ROUTE_MAX_SIZE, | ||
2558 | .procname = "max_size", | 2556 | .procname = "max_size", |
2559 | .data = &init_net.ipv6.sysctl.ip6_rt_max_size, | 2557 | .data = &init_net.ipv6.sysctl.ip6_rt_max_size, |
2560 | .maxlen = sizeof(int), | 2558 | .maxlen = sizeof(int), |
@@ -2562,69 +2560,55 @@ ctl_table ipv6_route_table_template[] = { | |||
2562 | .proc_handler = proc_dointvec, | 2560 | .proc_handler = proc_dointvec, |
2563 | }, | 2561 | }, |
2564 | { | 2562 | { |
2565 | .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL, | ||
2566 | .procname = "gc_min_interval", | 2563 | .procname = "gc_min_interval", |
2567 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, | 2564 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, |
2568 | .maxlen = sizeof(int), | 2565 | .maxlen = sizeof(int), |
2569 | .mode = 0644, | 2566 | .mode = 0644, |
2570 | .proc_handler = proc_dointvec_jiffies, | 2567 | .proc_handler = proc_dointvec_jiffies, |
2571 | .strategy = sysctl_jiffies, | ||
2572 | }, | 2568 | }, |
2573 | { | 2569 | { |
2574 | .ctl_name = NET_IPV6_ROUTE_GC_TIMEOUT, | ||
2575 | .procname = "gc_timeout", | 2570 | .procname = "gc_timeout", |
2576 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_timeout, | 2571 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_timeout, |
2577 | .maxlen = sizeof(int), | 2572 | .maxlen = sizeof(int), |
2578 | .mode = 0644, | 2573 | .mode = 0644, |
2579 | .proc_handler = proc_dointvec_jiffies, | 2574 | .proc_handler = proc_dointvec_jiffies, |
2580 | .strategy = sysctl_jiffies, | ||
2581 | }, | 2575 | }, |
2582 | { | 2576 | { |
2583 | .ctl_name = NET_IPV6_ROUTE_GC_INTERVAL, | ||
2584 | .procname = "gc_interval", | 2577 | .procname = "gc_interval", |
2585 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_interval, | 2578 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_interval, |
2586 | .maxlen = sizeof(int), | 2579 | .maxlen = sizeof(int), |
2587 | .mode = 0644, | 2580 | .mode = 0644, |
2588 | .proc_handler = proc_dointvec_jiffies, | 2581 | .proc_handler = proc_dointvec_jiffies, |
2589 | .strategy = sysctl_jiffies, | ||
2590 | }, | 2582 | }, |
2591 | { | 2583 | { |
2592 | .ctl_name = NET_IPV6_ROUTE_GC_ELASTICITY, | ||
2593 | .procname = "gc_elasticity", | 2584 | .procname = "gc_elasticity", |
2594 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity, | 2585 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity, |
2595 | .maxlen = sizeof(int), | 2586 | .maxlen = sizeof(int), |
2596 | .mode = 0644, | 2587 | .mode = 0644, |
2597 | .proc_handler = proc_dointvec_jiffies, | 2588 | .proc_handler = proc_dointvec_jiffies, |
2598 | .strategy = sysctl_jiffies, | ||
2599 | }, | 2589 | }, |
2600 | { | 2590 | { |
2601 | .ctl_name = NET_IPV6_ROUTE_MTU_EXPIRES, | ||
2602 | .procname = "mtu_expires", | 2591 | .procname = "mtu_expires", |
2603 | .data = &init_net.ipv6.sysctl.ip6_rt_mtu_expires, | 2592 | .data = &init_net.ipv6.sysctl.ip6_rt_mtu_expires, |
2604 | .maxlen = sizeof(int), | 2593 | .maxlen = sizeof(int), |
2605 | .mode = 0644, | 2594 | .mode = 0644, |
2606 | .proc_handler = proc_dointvec_jiffies, | 2595 | .proc_handler = proc_dointvec_jiffies, |
2607 | .strategy = sysctl_jiffies, | ||
2608 | }, | 2596 | }, |
2609 | { | 2597 | { |
2610 | .ctl_name = NET_IPV6_ROUTE_MIN_ADVMSS, | ||
2611 | .procname = "min_adv_mss", | 2598 | .procname = "min_adv_mss", |
2612 | .data = &init_net.ipv6.sysctl.ip6_rt_min_advmss, | 2599 | .data = &init_net.ipv6.sysctl.ip6_rt_min_advmss, |
2613 | .maxlen = sizeof(int), | 2600 | .maxlen = sizeof(int), |
2614 | .mode = 0644, | 2601 | .mode = 0644, |
2615 | .proc_handler = proc_dointvec_jiffies, | 2602 | .proc_handler = proc_dointvec_jiffies, |
2616 | .strategy = sysctl_jiffies, | ||
2617 | }, | 2603 | }, |
2618 | { | 2604 | { |
2619 | .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, | ||
2620 | .procname = "gc_min_interval_ms", | 2605 | .procname = "gc_min_interval_ms", |
2621 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, | 2606 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, |
2622 | .maxlen = sizeof(int), | 2607 | .maxlen = sizeof(int), |
2623 | .mode = 0644, | 2608 | .mode = 0644, |
2624 | .proc_handler = proc_dointvec_ms_jiffies, | 2609 | .proc_handler = proc_dointvec_ms_jiffies, |
2625 | .strategy = sysctl_ms_jiffies, | ||
2626 | }, | 2610 | }, |
2627 | { .ctl_name = 0 } | 2611 | { } |
2628 | }; | 2612 | }; |
2629 | 2613 | ||
2630 | struct ctl_table *ipv6_route_sysctl_init(struct net *net) | 2614 | struct ctl_table *ipv6_route_sysctl_init(struct net *net) |
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index 0dc6a4e5ed4a..c690736885b4 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c | |||
@@ -16,45 +16,41 @@ | |||
16 | 16 | ||
17 | static ctl_table ipv6_table_template[] = { | 17 | static ctl_table ipv6_table_template[] = { |
18 | { | 18 | { |
19 | .ctl_name = NET_IPV6_ROUTE, | ||
20 | .procname = "route", | 19 | .procname = "route", |
21 | .maxlen = 0, | 20 | .maxlen = 0, |
22 | .mode = 0555, | 21 | .mode = 0555, |
23 | .child = ipv6_route_table_template | 22 | .child = ipv6_route_table_template |
24 | }, | 23 | }, |
25 | { | 24 | { |
26 | .ctl_name = NET_IPV6_ICMP, | ||
27 | .procname = "icmp", | 25 | .procname = "icmp", |
28 | .maxlen = 0, | 26 | .maxlen = 0, |
29 | .mode = 0555, | 27 | .mode = 0555, |
30 | .child = ipv6_icmp_table_template | 28 | .child = ipv6_icmp_table_template |
31 | }, | 29 | }, |
32 | { | 30 | { |
33 | .ctl_name = NET_IPV6_BINDV6ONLY, | ||
34 | .procname = "bindv6only", | 31 | .procname = "bindv6only", |
35 | .data = &init_net.ipv6.sysctl.bindv6only, | 32 | .data = &init_net.ipv6.sysctl.bindv6only, |
36 | .maxlen = sizeof(int), | 33 | .maxlen = sizeof(int), |
37 | .mode = 0644, | 34 | .mode = 0644, |
38 | .proc_handler = proc_dointvec | 35 | .proc_handler = proc_dointvec |
39 | }, | 36 | }, |
40 | { .ctl_name = 0 } | 37 | { } |
41 | }; | 38 | }; |
42 | 39 | ||
43 | static ctl_table ipv6_rotable[] = { | 40 | static ctl_table ipv6_rotable[] = { |
44 | { | 41 | { |
45 | .ctl_name = NET_IPV6_MLD_MAX_MSF, | ||
46 | .procname = "mld_max_msf", | 42 | .procname = "mld_max_msf", |
47 | .data = &sysctl_mld_max_msf, | 43 | .data = &sysctl_mld_max_msf, |
48 | .maxlen = sizeof(int), | 44 | .maxlen = sizeof(int), |
49 | .mode = 0644, | 45 | .mode = 0644, |
50 | .proc_handler = proc_dointvec | 46 | .proc_handler = proc_dointvec |
51 | }, | 47 | }, |
52 | { .ctl_name = 0 } | 48 | { } |
53 | }; | 49 | }; |
54 | 50 | ||
55 | struct ctl_path net_ipv6_ctl_path[] = { | 51 | struct ctl_path net_ipv6_ctl_path[] = { |
56 | { .procname = "net", .ctl_name = CTL_NET, }, | 52 | { .procname = "net", }, |
57 | { .procname = "ipv6", .ctl_name = NET_IPV6, }, | 53 | { .procname = "ipv6", }, |
58 | { }, | 54 | { }, |
59 | }; | 55 | }; |
60 | EXPORT_SYMBOL_GPL(net_ipv6_ctl_path); | 56 | EXPORT_SYMBOL_GPL(net_ipv6_ctl_path); |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 8ec3d45cd1d9..7254e3f899a7 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -309,7 +309,6 @@ static void xfrm6_policy_fini(void) | |||
309 | #ifdef CONFIG_SYSCTL | 309 | #ifdef CONFIG_SYSCTL |
310 | static struct ctl_table xfrm6_policy_table[] = { | 310 | static struct ctl_table xfrm6_policy_table[] = { |
311 | { | 311 | { |
312 | .ctl_name = CTL_UNNUMBERED, | ||
313 | .procname = "xfrm6_gc_thresh", | 312 | .procname = "xfrm6_gc_thresh", |
314 | .data = &xfrm6_dst_ops.gc_thresh, | 313 | .data = &xfrm6_dst_ops.gc_thresh, |
315 | .maxlen = sizeof(int), | 314 | .maxlen = sizeof(int), |
diff --git a/net/ipx/sysctl_net_ipx.c b/net/ipx/sysctl_net_ipx.c index 633fcab35580..bd6dca00fb85 100644 --- a/net/ipx/sysctl_net_ipx.c +++ b/net/ipx/sysctl_net_ipx.c | |||
@@ -18,19 +18,18 @@ extern int sysctl_ipx_pprop_broadcasting; | |||
18 | 18 | ||
19 | static struct ctl_table ipx_table[] = { | 19 | static struct ctl_table ipx_table[] = { |
20 | { | 20 | { |
21 | .ctl_name = NET_IPX_PPROP_BROADCASTING, | ||
22 | .procname = "ipx_pprop_broadcasting", | 21 | .procname = "ipx_pprop_broadcasting", |
23 | .data = &sysctl_ipx_pprop_broadcasting, | 22 | .data = &sysctl_ipx_pprop_broadcasting, |
24 | .maxlen = sizeof(int), | 23 | .maxlen = sizeof(int), |
25 | .mode = 0644, | 24 | .mode = 0644, |
26 | .proc_handler = proc_dointvec, | 25 | .proc_handler = proc_dointvec, |
27 | }, | 26 | }, |
28 | { 0 }, | 27 | { }, |
29 | }; | 28 | }; |
30 | 29 | ||
31 | static struct ctl_path ipx_path[] = { | 30 | static struct ctl_path ipx_path[] = { |
32 | { .procname = "net", .ctl_name = CTL_NET, }, | 31 | { .procname = "net", }, |
33 | { .procname = "ipx", .ctl_name = NET_IPX, }, | 32 | { .procname = "ipx", }, |
34 | { } | 33 | { } |
35 | }; | 34 | }; |
36 | 35 | ||
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c index 5c86567e5a78..d0b70dadf73b 100644 --- a/net/irda/irsysctl.c +++ b/net/irda/irsysctl.c | |||
@@ -113,26 +113,21 @@ static int do_discovery(ctl_table *table, int write, | |||
113 | /* One file */ | 113 | /* One file */ |
114 | static ctl_table irda_table[] = { | 114 | static ctl_table irda_table[] = { |
115 | { | 115 | { |
116 | .ctl_name = NET_IRDA_DISCOVERY, | ||
117 | .procname = "discovery", | 116 | .procname = "discovery", |
118 | .data = &sysctl_discovery, | 117 | .data = &sysctl_discovery, |
119 | .maxlen = sizeof(int), | 118 | .maxlen = sizeof(int), |
120 | .mode = 0644, | 119 | .mode = 0644, |
121 | .proc_handler = do_discovery, | 120 | .proc_handler = do_discovery, |
122 | .strategy = sysctl_intvec | ||
123 | }, | 121 | }, |
124 | { | 122 | { |
125 | .ctl_name = NET_IRDA_DEVNAME, | ||
126 | .procname = "devname", | 123 | .procname = "devname", |
127 | .data = sysctl_devname, | 124 | .data = sysctl_devname, |
128 | .maxlen = 65, | 125 | .maxlen = 65, |
129 | .mode = 0644, | 126 | .mode = 0644, |
130 | .proc_handler = do_devname, | 127 | .proc_handler = do_devname, |
131 | .strategy = sysctl_string | ||
132 | }, | 128 | }, |
133 | #ifdef CONFIG_IRDA_DEBUG | 129 | #ifdef CONFIG_IRDA_DEBUG |
134 | { | 130 | { |
135 | .ctl_name = NET_IRDA_DEBUG, | ||
136 | .procname = "debug", | 131 | .procname = "debug", |
137 | .data = &irda_debug, | 132 | .data = &irda_debug, |
138 | .maxlen = sizeof(int), | 133 | .maxlen = sizeof(int), |
@@ -142,7 +137,6 @@ static ctl_table irda_table[] = { | |||
142 | #endif | 137 | #endif |
143 | #ifdef CONFIG_IRDA_FAST_RR | 138 | #ifdef CONFIG_IRDA_FAST_RR |
144 | { | 139 | { |
145 | .ctl_name = NET_IRDA_FAST_POLL, | ||
146 | .procname = "fast_poll_increase", | 140 | .procname = "fast_poll_increase", |
147 | .data = &sysctl_fast_poll_increase, | 141 | .data = &sysctl_fast_poll_increase, |
148 | .maxlen = sizeof(int), | 142 | .maxlen = sizeof(int), |
@@ -151,18 +145,15 @@ static ctl_table irda_table[] = { | |||
151 | }, | 145 | }, |
152 | #endif | 146 | #endif |
153 | { | 147 | { |
154 | .ctl_name = NET_IRDA_DISCOVERY_SLOTS, | ||
155 | .procname = "discovery_slots", | 148 | .procname = "discovery_slots", |
156 | .data = &sysctl_discovery_slots, | 149 | .data = &sysctl_discovery_slots, |
157 | .maxlen = sizeof(int), | 150 | .maxlen = sizeof(int), |
158 | .mode = 0644, | 151 | .mode = 0644, |
159 | .proc_handler = proc_dointvec_minmax, | 152 | .proc_handler = proc_dointvec_minmax, |
160 | .strategy = sysctl_intvec, | ||
161 | .extra1 = &min_discovery_slots, | 153 | .extra1 = &min_discovery_slots, |
162 | .extra2 = &max_discovery_slots | 154 | .extra2 = &max_discovery_slots |
163 | }, | 155 | }, |
164 | { | 156 | { |
165 | .ctl_name = NET_IRDA_DISCOVERY_TIMEOUT, | ||
166 | .procname = "discovery_timeout", | 157 | .procname = "discovery_timeout", |
167 | .data = &sysctl_discovery_timeout, | 158 | .data = &sysctl_discovery_timeout, |
168 | .maxlen = sizeof(int), | 159 | .maxlen = sizeof(int), |
@@ -170,99 +161,83 @@ static ctl_table irda_table[] = { | |||
170 | .proc_handler = proc_dointvec | 161 | .proc_handler = proc_dointvec |
171 | }, | 162 | }, |
172 | { | 163 | { |
173 | .ctl_name = NET_IRDA_SLOT_TIMEOUT, | ||
174 | .procname = "slot_timeout", | 164 | .procname = "slot_timeout", |
175 | .data = &sysctl_slot_timeout, | 165 | .data = &sysctl_slot_timeout, |
176 | .maxlen = sizeof(int), | 166 | .maxlen = sizeof(int), |
177 | .mode = 0644, | 167 | .mode = 0644, |
178 | .proc_handler = proc_dointvec_minmax, | 168 | .proc_handler = proc_dointvec_minmax, |
179 | .strategy = sysctl_intvec, | ||
180 | .extra1 = &min_slot_timeout, | 169 | .extra1 = &min_slot_timeout, |
181 | .extra2 = &max_slot_timeout | 170 | .extra2 = &max_slot_timeout |
182 | }, | 171 | }, |
183 | { | 172 | { |
184 | .ctl_name = NET_IRDA_MAX_BAUD_RATE, | ||
185 | .procname = "max_baud_rate", | 173 | .procname = "max_baud_rate", |
186 | .data = &sysctl_max_baud_rate, | 174 | .data = &sysctl_max_baud_rate, |
187 | .maxlen = sizeof(int), | 175 | .maxlen = sizeof(int), |
188 | .mode = 0644, | 176 | .mode = 0644, |
189 | .proc_handler = proc_dointvec_minmax, | 177 | .proc_handler = proc_dointvec_minmax, |
190 | .strategy = sysctl_intvec, | ||
191 | .extra1 = &min_max_baud_rate, | 178 | .extra1 = &min_max_baud_rate, |
192 | .extra2 = &max_max_baud_rate | 179 | .extra2 = &max_max_baud_rate |
193 | }, | 180 | }, |
194 | { | 181 | { |
195 | .ctl_name = NET_IRDA_MIN_TX_TURN_TIME, | ||
196 | .procname = "min_tx_turn_time", | 182 | .procname = "min_tx_turn_time", |
197 | .data = &sysctl_min_tx_turn_time, | 183 | .data = &sysctl_min_tx_turn_time, |
198 | .maxlen = sizeof(int), | 184 | .maxlen = sizeof(int), |
199 | .mode = 0644, | 185 | .mode = 0644, |
200 | .proc_handler = proc_dointvec_minmax, | 186 | .proc_handler = proc_dointvec_minmax, |
201 | .strategy = sysctl_intvec, | ||
202 | .extra1 = &min_min_tx_turn_time, | 187 | .extra1 = &min_min_tx_turn_time, |
203 | .extra2 = &max_min_tx_turn_time | 188 | .extra2 = &max_min_tx_turn_time |
204 | }, | 189 | }, |
205 | { | 190 | { |
206 | .ctl_name = NET_IRDA_MAX_TX_DATA_SIZE, | ||
207 | .procname = "max_tx_data_size", | 191 | .procname = "max_tx_data_size", |
208 | .data = &sysctl_max_tx_data_size, | 192 | .data = &sysctl_max_tx_data_size, |
209 | .maxlen = sizeof(int), | 193 | .maxlen = sizeof(int), |
210 | .mode = 0644, | 194 | .mode = 0644, |
211 | .proc_handler = proc_dointvec_minmax, | 195 | .proc_handler = proc_dointvec_minmax, |
212 | .strategy = sysctl_intvec, | ||
213 | .extra1 = &min_max_tx_data_size, | 196 | .extra1 = &min_max_tx_data_size, |
214 | .extra2 = &max_max_tx_data_size | 197 | .extra2 = &max_max_tx_data_size |
215 | }, | 198 | }, |
216 | { | 199 | { |
217 | .ctl_name = NET_IRDA_MAX_TX_WINDOW, | ||
218 | .procname = "max_tx_window", | 200 | .procname = "max_tx_window", |
219 | .data = &sysctl_max_tx_window, | 201 | .data = &sysctl_max_tx_window, |
220 | .maxlen = sizeof(int), | 202 | .maxlen = sizeof(int), |
221 | .mode = 0644, | 203 | .mode = 0644, |
222 | .proc_handler = proc_dointvec_minmax, | 204 | .proc_handler = proc_dointvec_minmax, |
223 | .strategy = sysctl_intvec, | ||
224 | .extra1 = &min_max_tx_window, | 205 | .extra1 = &min_max_tx_window, |
225 | .extra2 = &max_max_tx_window | 206 | .extra2 = &max_max_tx_window |
226 | }, | 207 | }, |
227 | { | 208 | { |
228 | .ctl_name = NET_IRDA_MAX_NOREPLY_TIME, | ||
229 | .procname = "max_noreply_time", | 209 | .procname = "max_noreply_time", |
230 | .data = &sysctl_max_noreply_time, | 210 | .data = &sysctl_max_noreply_time, |
231 | .maxlen = sizeof(int), | 211 | .maxlen = sizeof(int), |
232 | .mode = 0644, | 212 | .mode = 0644, |
233 | .proc_handler = proc_dointvec_minmax, | 213 | .proc_handler = proc_dointvec_minmax, |
234 | .strategy = sysctl_intvec, | ||
235 | .extra1 = &min_max_noreply_time, | 214 | .extra1 = &min_max_noreply_time, |
236 | .extra2 = &max_max_noreply_time | 215 | .extra2 = &max_max_noreply_time |
237 | }, | 216 | }, |
238 | { | 217 | { |
239 | .ctl_name = NET_IRDA_WARN_NOREPLY_TIME, | ||
240 | .procname = "warn_noreply_time", | 218 | .procname = "warn_noreply_time", |
241 | .data = &sysctl_warn_noreply_time, | 219 | .data = &sysctl_warn_noreply_time, |
242 | .maxlen = sizeof(int), | 220 | .maxlen = sizeof(int), |
243 | .mode = 0644, | 221 | .mode = 0644, |
244 | .proc_handler = proc_dointvec_minmax, | 222 | .proc_handler = proc_dointvec_minmax, |
245 | .strategy = sysctl_intvec, | ||
246 | .extra1 = &min_warn_noreply_time, | 223 | .extra1 = &min_warn_noreply_time, |
247 | .extra2 = &max_warn_noreply_time | 224 | .extra2 = &max_warn_noreply_time |
248 | }, | 225 | }, |
249 | { | 226 | { |
250 | .ctl_name = NET_IRDA_LAP_KEEPALIVE_TIME, | ||
251 | .procname = "lap_keepalive_time", | 227 | .procname = "lap_keepalive_time", |
252 | .data = &sysctl_lap_keepalive_time, | 228 | .data = &sysctl_lap_keepalive_time, |
253 | .maxlen = sizeof(int), | 229 | .maxlen = sizeof(int), |
254 | .mode = 0644, | 230 | .mode = 0644, |
255 | .proc_handler = proc_dointvec_minmax, | 231 | .proc_handler = proc_dointvec_minmax, |
256 | .strategy = sysctl_intvec, | ||
257 | .extra1 = &min_lap_keepalive_time, | 232 | .extra1 = &min_lap_keepalive_time, |
258 | .extra2 = &max_lap_keepalive_time | 233 | .extra2 = &max_lap_keepalive_time |
259 | }, | 234 | }, |
260 | { .ctl_name = 0 } | 235 | { } |
261 | }; | 236 | }; |
262 | 237 | ||
263 | static struct ctl_path irda_path[] = { | 238 | static struct ctl_path irda_path[] = { |
264 | { .procname = "net", .ctl_name = CTL_NET, }, | 239 | { .procname = "net", }, |
265 | { .procname = "irda", .ctl_name = NET_IRDA, }, | 240 | { .procname = "irda", }, |
266 | { } | 241 | { } |
267 | }; | 242 | }; |
268 | 243 | ||
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c index 57b9304d444c..e2ebe3586263 100644 --- a/net/llc/sysctl_net_llc.c +++ b/net/llc/sysctl_net_llc.c | |||
@@ -15,86 +15,73 @@ | |||
15 | 15 | ||
16 | static struct ctl_table llc2_timeout_table[] = { | 16 | static struct ctl_table llc2_timeout_table[] = { |
17 | { | 17 | { |
18 | .ctl_name = NET_LLC2_ACK_TIMEOUT, | ||
19 | .procname = "ack", | 18 | .procname = "ack", |
20 | .data = &sysctl_llc2_ack_timeout, | 19 | .data = &sysctl_llc2_ack_timeout, |
21 | .maxlen = sizeof(long), | 20 | .maxlen = sizeof(long), |
22 | .mode = 0644, | 21 | .mode = 0644, |
23 | .proc_handler = proc_dointvec_jiffies, | 22 | .proc_handler = proc_dointvec_jiffies, |
24 | .strategy = sysctl_jiffies, | ||
25 | }, | 23 | }, |
26 | { | 24 | { |
27 | .ctl_name = NET_LLC2_BUSY_TIMEOUT, | ||
28 | .procname = "busy", | 25 | .procname = "busy", |
29 | .data = &sysctl_llc2_busy_timeout, | 26 | .data = &sysctl_llc2_busy_timeout, |
30 | .maxlen = sizeof(long), | 27 | .maxlen = sizeof(long), |
31 | .mode = 0644, | 28 | .mode = 0644, |
32 | .proc_handler = proc_dointvec_jiffies, | 29 | .proc_handler = proc_dointvec_jiffies, |
33 | .strategy = sysctl_jiffies, | ||
34 | }, | 30 | }, |
35 | { | 31 | { |
36 | .ctl_name = NET_LLC2_P_TIMEOUT, | ||
37 | .procname = "p", | 32 | .procname = "p", |
38 | .data = &sysctl_llc2_p_timeout, | 33 | .data = &sysctl_llc2_p_timeout, |
39 | .maxlen = sizeof(long), | 34 | .maxlen = sizeof(long), |
40 | .mode = 0644, | 35 | .mode = 0644, |
41 | .proc_handler = proc_dointvec_jiffies, | 36 | .proc_handler = proc_dointvec_jiffies, |
42 | .strategy = sysctl_jiffies, | ||
43 | }, | 37 | }, |
44 | { | 38 | { |
45 | .ctl_name = NET_LLC2_REJ_TIMEOUT, | ||
46 | .procname = "rej", | 39 | .procname = "rej", |
47 | .data = &sysctl_llc2_rej_timeout, | 40 | .data = &sysctl_llc2_rej_timeout, |
48 | .maxlen = sizeof(long), | 41 | .maxlen = sizeof(long), |
49 | .mode = 0644, | 42 | .mode = 0644, |
50 | .proc_handler = proc_dointvec_jiffies, | 43 | .proc_handler = proc_dointvec_jiffies, |
51 | .strategy = sysctl_jiffies, | ||
52 | }, | 44 | }, |
53 | { 0 }, | 45 | { }, |
54 | }; | 46 | }; |
55 | 47 | ||
56 | static struct ctl_table llc_station_table[] = { | 48 | static struct ctl_table llc_station_table[] = { |
57 | { | 49 | { |
58 | .ctl_name = NET_LLC_STATION_ACK_TIMEOUT, | ||
59 | .procname = "ack_timeout", | 50 | .procname = "ack_timeout", |
60 | .data = &sysctl_llc_station_ack_timeout, | 51 | .data = &sysctl_llc_station_ack_timeout, |
61 | .maxlen = sizeof(long), | 52 | .maxlen = sizeof(long), |
62 | .mode = 0644, | 53 | .mode = 0644, |
63 | .proc_handler = proc_dointvec_jiffies, | 54 | .proc_handler = proc_dointvec_jiffies, |
64 | .strategy = sysctl_jiffies, | ||
65 | }, | 55 | }, |
66 | { 0 }, | 56 | { }, |
67 | }; | 57 | }; |
68 | 58 | ||
69 | static struct ctl_table llc2_dir_timeout_table[] = { | 59 | static struct ctl_table llc2_dir_timeout_table[] = { |
70 | { | 60 | { |
71 | .ctl_name = NET_LLC2, | ||
72 | .procname = "timeout", | 61 | .procname = "timeout", |
73 | .mode = 0555, | 62 | .mode = 0555, |
74 | .child = llc2_timeout_table, | 63 | .child = llc2_timeout_table, |
75 | }, | 64 | }, |
76 | { 0 }, | 65 | { }, |
77 | }; | 66 | }; |
78 | 67 | ||
79 | static struct ctl_table llc_table[] = { | 68 | static struct ctl_table llc_table[] = { |
80 | { | 69 | { |
81 | .ctl_name = NET_LLC2, | ||
82 | .procname = "llc2", | 70 | .procname = "llc2", |
83 | .mode = 0555, | 71 | .mode = 0555, |
84 | .child = llc2_dir_timeout_table, | 72 | .child = llc2_dir_timeout_table, |
85 | }, | 73 | }, |
86 | { | 74 | { |
87 | .ctl_name = NET_LLC_STATION, | ||
88 | .procname = "station", | 75 | .procname = "station", |
89 | .mode = 0555, | 76 | .mode = 0555, |
90 | .child = llc_station_table, | 77 | .child = llc_station_table, |
91 | }, | 78 | }, |
92 | { 0 }, | 79 | { }, |
93 | }; | 80 | }; |
94 | 81 | ||
95 | static struct ctl_path llc_path[] = { | 82 | static struct ctl_path llc_path[] = { |
96 | { .procname = "net", .ctl_name = CTL_NET, }, | 83 | { .procname = "net", }, |
97 | { .procname = "llc", .ctl_name = NET_LLC, }, | 84 | { .procname = "llc", }, |
98 | { } | 85 | { } |
99 | }; | 86 | }; |
100 | 87 | ||
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 5bb34737501f..60ec4e4badaa 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c | |||
@@ -273,8 +273,8 @@ void __init netfilter_init(void) | |||
273 | 273 | ||
274 | #ifdef CONFIG_SYSCTL | 274 | #ifdef CONFIG_SYSCTL |
275 | struct ctl_path nf_net_netfilter_sysctl_path[] = { | 275 | struct ctl_path nf_net_netfilter_sysctl_path[] = { |
276 | { .procname = "net", .ctl_name = CTL_NET, }, | 276 | { .procname = "net", }, |
277 | { .procname = "netfilter", .ctl_name = NET_NETFILTER, }, | 277 | { .procname = "netfilter", }, |
278 | { } | 278 | { } |
279 | }; | 279 | }; |
280 | EXPORT_SYMBOL_GPL(nf_net_netfilter_sysctl_path); | 280 | EXPORT_SYMBOL_GPL(nf_net_netfilter_sysctl_path); |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 446e9bd4b4bc..e55a6861d26f 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -1706,12 +1706,12 @@ static struct ctl_table vs_vars[] = { | |||
1706 | .mode = 0644, | 1706 | .mode = 0644, |
1707 | .proc_handler = proc_dointvec, | 1707 | .proc_handler = proc_dointvec, |
1708 | }, | 1708 | }, |
1709 | { .ctl_name = 0 } | 1709 | { } |
1710 | }; | 1710 | }; |
1711 | 1711 | ||
1712 | const struct ctl_path net_vs_ctl_path[] = { | 1712 | const struct ctl_path net_vs_ctl_path[] = { |
1713 | { .procname = "net", .ctl_name = CTL_NET, }, | 1713 | { .procname = "net", }, |
1714 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 1714 | { .procname = "ipv4", }, |
1715 | { .procname = "vs", }, | 1715 | { .procname = "vs", }, |
1716 | { } | 1716 | { } |
1717 | }; | 1717 | }; |
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index c1757f3620cd..1b9370db2305 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c | |||
@@ -121,7 +121,7 @@ static ctl_table vs_vars_table[] = { | |||
121 | .mode = 0644, | 121 | .mode = 0644, |
122 | .proc_handler = proc_dointvec_jiffies, | 122 | .proc_handler = proc_dointvec_jiffies, |
123 | }, | 123 | }, |
124 | { .ctl_name = 0 } | 124 | { } |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static struct ctl_table_header * sysctl_header; | 127 | static struct ctl_table_header * sysctl_header; |
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 715b57f9540d..f7476b95ab46 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c | |||
@@ -302,7 +302,7 @@ static ctl_table vs_vars_table[] = { | |||
302 | .mode = 0644, | 302 | .mode = 0644, |
303 | .proc_handler = proc_dointvec_jiffies, | 303 | .proc_handler = proc_dointvec_jiffies, |
304 | }, | 304 | }, |
305 | { .ctl_name = 0 } | 305 | { } |
306 | }; | 306 | }; |
307 | 307 | ||
308 | static struct ctl_table_header * sysctl_header; | 308 | static struct ctl_table_header * sysctl_header; |
diff --git a/net/netfilter/nf_conntrack_acct.c b/net/netfilter/nf_conntrack_acct.c index 4a1d94aac20b..018f90db511c 100644 --- a/net/netfilter/nf_conntrack_acct.c +++ b/net/netfilter/nf_conntrack_acct.c | |||
@@ -30,7 +30,6 @@ MODULE_PARM_DESC(acct, "Enable connection tracking flow accounting."); | |||
30 | #ifdef CONFIG_SYSCTL | 30 | #ifdef CONFIG_SYSCTL |
31 | static struct ctl_table acct_sysctl_table[] = { | 31 | static struct ctl_table acct_sysctl_table[] = { |
32 | { | 32 | { |
33 | .ctl_name = CTL_UNNUMBERED, | ||
34 | .procname = "nf_conntrack_acct", | 33 | .procname = "nf_conntrack_acct", |
35 | .data = &init_net.ct.sysctl_acct, | 34 | .data = &init_net.ct.sysctl_acct, |
36 | .maxlen = sizeof(unsigned int), | 35 | .maxlen = sizeof(unsigned int), |
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index aee560b4768d..d5a9bcd7d61b 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
@@ -151,7 +151,6 @@ static int nf_ct_events_retry_timeout __read_mostly = 15*HZ; | |||
151 | #ifdef CONFIG_SYSCTL | 151 | #ifdef CONFIG_SYSCTL |
152 | static struct ctl_table event_sysctl_table[] = { | 152 | static struct ctl_table event_sysctl_table[] = { |
153 | { | 153 | { |
154 | .ctl_name = CTL_UNNUMBERED, | ||
155 | .procname = "nf_conntrack_events", | 154 | .procname = "nf_conntrack_events", |
156 | .data = &init_net.ct.sysctl_events, | 155 | .data = &init_net.ct.sysctl_events, |
157 | .maxlen = sizeof(unsigned int), | 156 | .maxlen = sizeof(unsigned int), |
@@ -159,7 +158,6 @@ static struct ctl_table event_sysctl_table[] = { | |||
159 | .proc_handler = proc_dointvec, | 158 | .proc_handler = proc_dointvec, |
160 | }, | 159 | }, |
161 | { | 160 | { |
162 | .ctl_name = CTL_UNNUMBERED, | ||
163 | .procname = "nf_conntrack_events_retry_timeout", | 161 | .procname = "nf_conntrack_events_retry_timeout", |
164 | .data = &init_net.ct.sysctl_events_retry_timeout, | 162 | .data = &init_net.ct.sysctl_events_retry_timeout, |
165 | .maxlen = sizeof(unsigned int), | 163 | .maxlen = sizeof(unsigned int), |
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c index 1b816a2ea813..7bf1395b4158 100644 --- a/net/netfilter/nf_conntrack_proto_dccp.c +++ b/net/netfilter/nf_conntrack_proto_dccp.c | |||
@@ -703,64 +703,54 @@ static int dccp_nlattr_size(void) | |||
703 | /* template, data assigned later */ | 703 | /* template, data assigned later */ |
704 | static struct ctl_table dccp_sysctl_table[] = { | 704 | static struct ctl_table dccp_sysctl_table[] = { |
705 | { | 705 | { |
706 | .ctl_name = CTL_UNNUMBERED, | ||
707 | .procname = "nf_conntrack_dccp_timeout_request", | 706 | .procname = "nf_conntrack_dccp_timeout_request", |
708 | .maxlen = sizeof(unsigned int), | 707 | .maxlen = sizeof(unsigned int), |
709 | .mode = 0644, | 708 | .mode = 0644, |
710 | .proc_handler = proc_dointvec_jiffies, | 709 | .proc_handler = proc_dointvec_jiffies, |
711 | }, | 710 | }, |
712 | { | 711 | { |
713 | .ctl_name = CTL_UNNUMBERED, | ||
714 | .procname = "nf_conntrack_dccp_timeout_respond", | 712 | .procname = "nf_conntrack_dccp_timeout_respond", |
715 | .maxlen = sizeof(unsigned int), | 713 | .maxlen = sizeof(unsigned int), |
716 | .mode = 0644, | 714 | .mode = 0644, |
717 | .proc_handler = proc_dointvec_jiffies, | 715 | .proc_handler = proc_dointvec_jiffies, |
718 | }, | 716 | }, |
719 | { | 717 | { |
720 | .ctl_name = CTL_UNNUMBERED, | ||
721 | .procname = "nf_conntrack_dccp_timeout_partopen", | 718 | .procname = "nf_conntrack_dccp_timeout_partopen", |
722 | .maxlen = sizeof(unsigned int), | 719 | .maxlen = sizeof(unsigned int), |
723 | .mode = 0644, | 720 | .mode = 0644, |
724 | .proc_handler = proc_dointvec_jiffies, | 721 | .proc_handler = proc_dointvec_jiffies, |
725 | }, | 722 | }, |
726 | { | 723 | { |
727 | .ctl_name = CTL_UNNUMBERED, | ||
728 | .procname = "nf_conntrack_dccp_timeout_open", | 724 | .procname = "nf_conntrack_dccp_timeout_open", |
729 | .maxlen = sizeof(unsigned int), | 725 | .maxlen = sizeof(unsigned int), |
730 | .mode = 0644, | 726 | .mode = 0644, |
731 | .proc_handler = proc_dointvec_jiffies, | 727 | .proc_handler = proc_dointvec_jiffies, |
732 | }, | 728 | }, |
733 | { | 729 | { |
734 | .ctl_name = CTL_UNNUMBERED, | ||
735 | .procname = "nf_conntrack_dccp_timeout_closereq", | 730 | .procname = "nf_conntrack_dccp_timeout_closereq", |
736 | .maxlen = sizeof(unsigned int), | 731 | .maxlen = sizeof(unsigned int), |
737 | .mode = 0644, | 732 | .mode = 0644, |
738 | .proc_handler = proc_dointvec_jiffies, | 733 | .proc_handler = proc_dointvec_jiffies, |
739 | }, | 734 | }, |
740 | { | 735 | { |
741 | .ctl_name = CTL_UNNUMBERED, | ||
742 | .procname = "nf_conntrack_dccp_timeout_closing", | 736 | .procname = "nf_conntrack_dccp_timeout_closing", |
743 | .maxlen = sizeof(unsigned int), | 737 | .maxlen = sizeof(unsigned int), |
744 | .mode = 0644, | 738 | .mode = 0644, |
745 | .proc_handler = proc_dointvec_jiffies, | 739 | .proc_handler = proc_dointvec_jiffies, |
746 | }, | 740 | }, |
747 | { | 741 | { |
748 | .ctl_name = CTL_UNNUMBERED, | ||
749 | .procname = "nf_conntrack_dccp_timeout_timewait", | 742 | .procname = "nf_conntrack_dccp_timeout_timewait", |
750 | .maxlen = sizeof(unsigned int), | 743 | .maxlen = sizeof(unsigned int), |
751 | .mode = 0644, | 744 | .mode = 0644, |
752 | .proc_handler = proc_dointvec_jiffies, | 745 | .proc_handler = proc_dointvec_jiffies, |
753 | }, | 746 | }, |
754 | { | 747 | { |
755 | .ctl_name = CTL_UNNUMBERED, | ||
756 | .procname = "nf_conntrack_dccp_loose", | 748 | .procname = "nf_conntrack_dccp_loose", |
757 | .maxlen = sizeof(int), | 749 | .maxlen = sizeof(int), |
758 | .mode = 0644, | 750 | .mode = 0644, |
759 | .proc_handler = proc_dointvec, | 751 | .proc_handler = proc_dointvec, |
760 | }, | 752 | }, |
761 | { | 753 | { } |
762 | .ctl_name = 0, | ||
763 | } | ||
764 | }; | 754 | }; |
765 | #endif /* CONFIG_SYSCTL */ | 755 | #endif /* CONFIG_SYSCTL */ |
766 | 756 | ||
diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c index 829374f426c4..e2091d0c7a2f 100644 --- a/net/netfilter/nf_conntrack_proto_generic.c +++ b/net/netfilter/nf_conntrack_proto_generic.c | |||
@@ -69,9 +69,7 @@ static struct ctl_table generic_sysctl_table[] = { | |||
69 | .mode = 0644, | 69 | .mode = 0644, |
70 | .proc_handler = proc_dointvec_jiffies, | 70 | .proc_handler = proc_dointvec_jiffies, |
71 | }, | 71 | }, |
72 | { | 72 | { } |
73 | .ctl_name = 0 | ||
74 | } | ||
75 | }; | 73 | }; |
76 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | 74 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
77 | static struct ctl_table generic_compat_sysctl_table[] = { | 75 | static struct ctl_table generic_compat_sysctl_table[] = { |
@@ -82,9 +80,7 @@ static struct ctl_table generic_compat_sysctl_table[] = { | |||
82 | .mode = 0644, | 80 | .mode = 0644, |
83 | .proc_handler = proc_dointvec_jiffies, | 81 | .proc_handler = proc_dointvec_jiffies, |
84 | }, | 82 | }, |
85 | { | 83 | { } |
86 | .ctl_name = 0 | ||
87 | } | ||
88 | }; | 84 | }; |
89 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ | 85 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ |
90 | #endif /* CONFIG_SYSCTL */ | 86 | #endif /* CONFIG_SYSCTL */ |
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index c10e6f36e31e..f9d930f80276 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c | |||
@@ -595,9 +595,7 @@ static struct ctl_table sctp_sysctl_table[] = { | |||
595 | .mode = 0644, | 595 | .mode = 0644, |
596 | .proc_handler = proc_dointvec_jiffies, | 596 | .proc_handler = proc_dointvec_jiffies, |
597 | }, | 597 | }, |
598 | { | 598 | { } |
599 | .ctl_name = 0 | ||
600 | } | ||
601 | }; | 599 | }; |
602 | 600 | ||
603 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | 601 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
@@ -651,9 +649,7 @@ static struct ctl_table sctp_compat_sysctl_table[] = { | |||
651 | .mode = 0644, | 649 | .mode = 0644, |
652 | .proc_handler = proc_dointvec_jiffies, | 650 | .proc_handler = proc_dointvec_jiffies, |
653 | }, | 651 | }, |
654 | { | 652 | { } |
655 | .ctl_name = 0 | ||
656 | } | ||
657 | }; | 653 | }; |
658 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ | 654 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ |
659 | #endif | 655 | #endif |
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index ba2b76937283..7eda8b8e36a0 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -1291,7 +1291,6 @@ static struct ctl_table tcp_sysctl_table[] = { | |||
1291 | .proc_handler = proc_dointvec_jiffies, | 1291 | .proc_handler = proc_dointvec_jiffies, |
1292 | }, | 1292 | }, |
1293 | { | 1293 | { |
1294 | .ctl_name = NET_NF_CONNTRACK_TCP_LOOSE, | ||
1295 | .procname = "nf_conntrack_tcp_loose", | 1294 | .procname = "nf_conntrack_tcp_loose", |
1296 | .data = &nf_ct_tcp_loose, | 1295 | .data = &nf_ct_tcp_loose, |
1297 | .maxlen = sizeof(unsigned int), | 1296 | .maxlen = sizeof(unsigned int), |
@@ -1299,7 +1298,6 @@ static struct ctl_table tcp_sysctl_table[] = { | |||
1299 | .proc_handler = proc_dointvec, | 1298 | .proc_handler = proc_dointvec, |
1300 | }, | 1299 | }, |
1301 | { | 1300 | { |
1302 | .ctl_name = NET_NF_CONNTRACK_TCP_BE_LIBERAL, | ||
1303 | .procname = "nf_conntrack_tcp_be_liberal", | 1301 | .procname = "nf_conntrack_tcp_be_liberal", |
1304 | .data = &nf_ct_tcp_be_liberal, | 1302 | .data = &nf_ct_tcp_be_liberal, |
1305 | .maxlen = sizeof(unsigned int), | 1303 | .maxlen = sizeof(unsigned int), |
@@ -1307,16 +1305,13 @@ static struct ctl_table tcp_sysctl_table[] = { | |||
1307 | .proc_handler = proc_dointvec, | 1305 | .proc_handler = proc_dointvec, |
1308 | }, | 1306 | }, |
1309 | { | 1307 | { |
1310 | .ctl_name = NET_NF_CONNTRACK_TCP_MAX_RETRANS, | ||
1311 | .procname = "nf_conntrack_tcp_max_retrans", | 1308 | .procname = "nf_conntrack_tcp_max_retrans", |
1312 | .data = &nf_ct_tcp_max_retrans, | 1309 | .data = &nf_ct_tcp_max_retrans, |
1313 | .maxlen = sizeof(unsigned int), | 1310 | .maxlen = sizeof(unsigned int), |
1314 | .mode = 0644, | 1311 | .mode = 0644, |
1315 | .proc_handler = proc_dointvec, | 1312 | .proc_handler = proc_dointvec, |
1316 | }, | 1313 | }, |
1317 | { | 1314 | { } |
1318 | .ctl_name = 0 | ||
1319 | } | ||
1320 | }; | 1315 | }; |
1321 | 1316 | ||
1322 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | 1317 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
@@ -1392,7 +1387,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = { | |||
1392 | .proc_handler = proc_dointvec_jiffies, | 1387 | .proc_handler = proc_dointvec_jiffies, |
1393 | }, | 1388 | }, |
1394 | { | 1389 | { |
1395 | .ctl_name = NET_IPV4_NF_CONNTRACK_TCP_LOOSE, | ||
1396 | .procname = "ip_conntrack_tcp_loose", | 1390 | .procname = "ip_conntrack_tcp_loose", |
1397 | .data = &nf_ct_tcp_loose, | 1391 | .data = &nf_ct_tcp_loose, |
1398 | .maxlen = sizeof(unsigned int), | 1392 | .maxlen = sizeof(unsigned int), |
@@ -1400,7 +1394,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = { | |||
1400 | .proc_handler = proc_dointvec, | 1394 | .proc_handler = proc_dointvec, |
1401 | }, | 1395 | }, |
1402 | { | 1396 | { |
1403 | .ctl_name = NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL, | ||
1404 | .procname = "ip_conntrack_tcp_be_liberal", | 1397 | .procname = "ip_conntrack_tcp_be_liberal", |
1405 | .data = &nf_ct_tcp_be_liberal, | 1398 | .data = &nf_ct_tcp_be_liberal, |
1406 | .maxlen = sizeof(unsigned int), | 1399 | .maxlen = sizeof(unsigned int), |
@@ -1408,16 +1401,13 @@ static struct ctl_table tcp_compat_sysctl_table[] = { | |||
1408 | .proc_handler = proc_dointvec, | 1401 | .proc_handler = proc_dointvec, |
1409 | }, | 1402 | }, |
1410 | { | 1403 | { |
1411 | .ctl_name = NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS, | ||
1412 | .procname = "ip_conntrack_tcp_max_retrans", | 1404 | .procname = "ip_conntrack_tcp_max_retrans", |
1413 | .data = &nf_ct_tcp_max_retrans, | 1405 | .data = &nf_ct_tcp_max_retrans, |
1414 | .maxlen = sizeof(unsigned int), | 1406 | .maxlen = sizeof(unsigned int), |
1415 | .mode = 0644, | 1407 | .mode = 0644, |
1416 | .proc_handler = proc_dointvec, | 1408 | .proc_handler = proc_dointvec, |
1417 | }, | 1409 | }, |
1418 | { | 1410 | { } |
1419 | .ctl_name = 0 | ||
1420 | } | ||
1421 | }; | 1411 | }; |
1422 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ | 1412 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ |
1423 | #endif /* CONFIG_SYSCTL */ | 1413 | #endif /* CONFIG_SYSCTL */ |
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c index 70809d117b91..5c5518bedb4b 100644 --- a/net/netfilter/nf_conntrack_proto_udp.c +++ b/net/netfilter/nf_conntrack_proto_udp.c | |||
@@ -154,9 +154,7 @@ static struct ctl_table udp_sysctl_table[] = { | |||
154 | .mode = 0644, | 154 | .mode = 0644, |
155 | .proc_handler = proc_dointvec_jiffies, | 155 | .proc_handler = proc_dointvec_jiffies, |
156 | }, | 156 | }, |
157 | { | 157 | { } |
158 | .ctl_name = 0 | ||
159 | } | ||
160 | }; | 158 | }; |
161 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | 159 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
162 | static struct ctl_table udp_compat_sysctl_table[] = { | 160 | static struct ctl_table udp_compat_sysctl_table[] = { |
@@ -174,9 +172,7 @@ static struct ctl_table udp_compat_sysctl_table[] = { | |||
174 | .mode = 0644, | 172 | .mode = 0644, |
175 | .proc_handler = proc_dointvec_jiffies, | 173 | .proc_handler = proc_dointvec_jiffies, |
176 | }, | 174 | }, |
177 | { | 175 | { } |
178 | .ctl_name = 0 | ||
179 | } | ||
180 | }; | 176 | }; |
181 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ | 177 | #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ |
182 | #endif /* CONFIG_SYSCTL */ | 178 | #endif /* CONFIG_SYSCTL */ |
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c index 0badedc542d3..458655bb2106 100644 --- a/net/netfilter/nf_conntrack_proto_udplite.c +++ b/net/netfilter/nf_conntrack_proto_udplite.c | |||
@@ -146,7 +146,6 @@ static unsigned int udplite_sysctl_table_users; | |||
146 | static struct ctl_table_header *udplite_sysctl_header; | 146 | static struct ctl_table_header *udplite_sysctl_header; |
147 | static struct ctl_table udplite_sysctl_table[] = { | 147 | static struct ctl_table udplite_sysctl_table[] = { |
148 | { | 148 | { |
149 | .ctl_name = CTL_UNNUMBERED, | ||
150 | .procname = "nf_conntrack_udplite_timeout", | 149 | .procname = "nf_conntrack_udplite_timeout", |
151 | .data = &nf_ct_udplite_timeout, | 150 | .data = &nf_ct_udplite_timeout, |
152 | .maxlen = sizeof(unsigned int), | 151 | .maxlen = sizeof(unsigned int), |
@@ -154,16 +153,13 @@ static struct ctl_table udplite_sysctl_table[] = { | |||
154 | .proc_handler = proc_dointvec_jiffies, | 153 | .proc_handler = proc_dointvec_jiffies, |
155 | }, | 154 | }, |
156 | { | 155 | { |
157 | .ctl_name = CTL_UNNUMBERED, | ||
158 | .procname = "nf_conntrack_udplite_timeout_stream", | 156 | .procname = "nf_conntrack_udplite_timeout_stream", |
159 | .data = &nf_ct_udplite_timeout_stream, | 157 | .data = &nf_ct_udplite_timeout_stream, |
160 | .maxlen = sizeof(unsigned int), | 158 | .maxlen = sizeof(unsigned int), |
161 | .mode = 0644, | 159 | .mode = 0644, |
162 | .proc_handler = proc_dointvec_jiffies, | 160 | .proc_handler = proc_dointvec_jiffies, |
163 | }, | 161 | }, |
164 | { | 162 | { } |
165 | .ctl_name = 0 | ||
166 | } | ||
167 | }; | 163 | }; |
168 | #endif /* CONFIG_SYSCTL */ | 164 | #endif /* CONFIG_SYSCTL */ |
169 | 165 | ||
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 193515381970..028aba667ef7 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c | |||
@@ -340,7 +340,6 @@ static struct ctl_table_header *nf_ct_netfilter_header; | |||
340 | 340 | ||
341 | static ctl_table nf_ct_sysctl_table[] = { | 341 | static ctl_table nf_ct_sysctl_table[] = { |
342 | { | 342 | { |
343 | .ctl_name = NET_NF_CONNTRACK_MAX, | ||
344 | .procname = "nf_conntrack_max", | 343 | .procname = "nf_conntrack_max", |
345 | .data = &nf_conntrack_max, | 344 | .data = &nf_conntrack_max, |
346 | .maxlen = sizeof(int), | 345 | .maxlen = sizeof(int), |
@@ -348,7 +347,6 @@ static ctl_table nf_ct_sysctl_table[] = { | |||
348 | .proc_handler = proc_dointvec, | 347 | .proc_handler = proc_dointvec, |
349 | }, | 348 | }, |
350 | { | 349 | { |
351 | .ctl_name = NET_NF_CONNTRACK_COUNT, | ||
352 | .procname = "nf_conntrack_count", | 350 | .procname = "nf_conntrack_count", |
353 | .data = &init_net.ct.count, | 351 | .data = &init_net.ct.count, |
354 | .maxlen = sizeof(int), | 352 | .maxlen = sizeof(int), |
@@ -356,7 +354,6 @@ static ctl_table nf_ct_sysctl_table[] = { | |||
356 | .proc_handler = proc_dointvec, | 354 | .proc_handler = proc_dointvec, |
357 | }, | 355 | }, |
358 | { | 356 | { |
359 | .ctl_name = NET_NF_CONNTRACK_BUCKETS, | ||
360 | .procname = "nf_conntrack_buckets", | 357 | .procname = "nf_conntrack_buckets", |
361 | .data = &nf_conntrack_htable_size, | 358 | .data = &nf_conntrack_htable_size, |
362 | .maxlen = sizeof(unsigned int), | 359 | .maxlen = sizeof(unsigned int), |
@@ -364,7 +361,6 @@ static ctl_table nf_ct_sysctl_table[] = { | |||
364 | .proc_handler = proc_dointvec, | 361 | .proc_handler = proc_dointvec, |
365 | }, | 362 | }, |
366 | { | 363 | { |
367 | .ctl_name = NET_NF_CONNTRACK_CHECKSUM, | ||
368 | .procname = "nf_conntrack_checksum", | 364 | .procname = "nf_conntrack_checksum", |
369 | .data = &init_net.ct.sysctl_checksum, | 365 | .data = &init_net.ct.sysctl_checksum, |
370 | .maxlen = sizeof(unsigned int), | 366 | .maxlen = sizeof(unsigned int), |
@@ -372,43 +368,39 @@ static ctl_table nf_ct_sysctl_table[] = { | |||
372 | .proc_handler = proc_dointvec, | 368 | .proc_handler = proc_dointvec, |
373 | }, | 369 | }, |
374 | { | 370 | { |
375 | .ctl_name = NET_NF_CONNTRACK_LOG_INVALID, | ||
376 | .procname = "nf_conntrack_log_invalid", | 371 | .procname = "nf_conntrack_log_invalid", |
377 | .data = &init_net.ct.sysctl_log_invalid, | 372 | .data = &init_net.ct.sysctl_log_invalid, |
378 | .maxlen = sizeof(unsigned int), | 373 | .maxlen = sizeof(unsigned int), |
379 | .mode = 0644, | 374 | .mode = 0644, |
380 | .proc_handler = proc_dointvec_minmax, | 375 | .proc_handler = proc_dointvec_minmax, |
381 | .strategy = sysctl_intvec, | ||
382 | .extra1 = &log_invalid_proto_min, | 376 | .extra1 = &log_invalid_proto_min, |
383 | .extra2 = &log_invalid_proto_max, | 377 | .extra2 = &log_invalid_proto_max, |
384 | }, | 378 | }, |
385 | { | 379 | { |
386 | .ctl_name = CTL_UNNUMBERED, | ||
387 | .procname = "nf_conntrack_expect_max", | 380 | .procname = "nf_conntrack_expect_max", |
388 | .data = &nf_ct_expect_max, | 381 | .data = &nf_ct_expect_max, |
389 | .maxlen = sizeof(int), | 382 | .maxlen = sizeof(int), |
390 | .mode = 0644, | 383 | .mode = 0644, |
391 | .proc_handler = proc_dointvec, | 384 | .proc_handler = proc_dointvec, |
392 | }, | 385 | }, |
393 | { .ctl_name = 0 } | 386 | { } |
394 | }; | 387 | }; |
395 | 388 | ||
396 | #define NET_NF_CONNTRACK_MAX 2089 | 389 | #define NET_NF_CONNTRACK_MAX 2089 |
397 | 390 | ||
398 | static ctl_table nf_ct_netfilter_table[] = { | 391 | static ctl_table nf_ct_netfilter_table[] = { |
399 | { | 392 | { |
400 | .ctl_name = NET_NF_CONNTRACK_MAX, | ||
401 | .procname = "nf_conntrack_max", | 393 | .procname = "nf_conntrack_max", |
402 | .data = &nf_conntrack_max, | 394 | .data = &nf_conntrack_max, |
403 | .maxlen = sizeof(int), | 395 | .maxlen = sizeof(int), |
404 | .mode = 0644, | 396 | .mode = 0644, |
405 | .proc_handler = proc_dointvec, | 397 | .proc_handler = proc_dointvec, |
406 | }, | 398 | }, |
407 | { .ctl_name = 0 } | 399 | { } |
408 | }; | 400 | }; |
409 | 401 | ||
410 | static struct ctl_path nf_ct_path[] = { | 402 | static struct ctl_path nf_ct_path[] = { |
411 | { .procname = "net", .ctl_name = CTL_NET, }, | 403 | { .procname = "net", }, |
412 | { } | 404 | { } |
413 | }; | 405 | }; |
414 | 406 | ||
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index d65d3481919c..015725a5cd50 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -208,9 +208,9 @@ static const struct file_operations nflog_file_ops = { | |||
208 | 208 | ||
209 | #ifdef CONFIG_SYSCTL | 209 | #ifdef CONFIG_SYSCTL |
210 | static struct ctl_path nf_log_sysctl_path[] = { | 210 | static struct ctl_path nf_log_sysctl_path[] = { |
211 | { .procname = "net", .ctl_name = CTL_NET, }, | 211 | { .procname = "net", }, |
212 | { .procname = "netfilter", .ctl_name = NET_NETFILTER, }, | 212 | { .procname = "netfilter", }, |
213 | { .procname = "nf_log", .ctl_name = CTL_UNNUMBERED, }, | 213 | { .procname = "nf_log", }, |
214 | { } | 214 | { } |
215 | }; | 215 | }; |
216 | 216 | ||
@@ -265,7 +265,6 @@ static __init int netfilter_log_sysctl_init(void) | |||
265 | 265 | ||
266 | for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) { | 266 | for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) { |
267 | snprintf(nf_log_sysctl_fnames[i-NFPROTO_UNSPEC], 3, "%d", i); | 267 | snprintf(nf_log_sysctl_fnames[i-NFPROTO_UNSPEC], 3, "%d", i); |
268 | nf_log_sysctl_table[i].ctl_name = CTL_UNNUMBERED; | ||
269 | nf_log_sysctl_table[i].procname = | 268 | nf_log_sysctl_table[i].procname = |
270 | nf_log_sysctl_fnames[i-NFPROTO_UNSPEC]; | 269 | nf_log_sysctl_fnames[i-NFPROTO_UNSPEC]; |
271 | nf_log_sysctl_table[i].data = NULL; | 270 | nf_log_sysctl_table[i].data = NULL; |
diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c index 7b49591fe87c..1e0fa9e57aac 100644 --- a/net/netrom/sysctl_net_netrom.c +++ b/net/netrom/sysctl_net_netrom.c | |||
@@ -36,143 +36,119 @@ static struct ctl_table_header *nr_table_header; | |||
36 | 36 | ||
37 | static ctl_table nr_table[] = { | 37 | static ctl_table nr_table[] = { |
38 | { | 38 | { |
39 | .ctl_name = NET_NETROM_DEFAULT_PATH_QUALITY, | ||
40 | .procname = "default_path_quality", | 39 | .procname = "default_path_quality", |
41 | .data = &sysctl_netrom_default_path_quality, | 40 | .data = &sysctl_netrom_default_path_quality, |
42 | .maxlen = sizeof(int), | 41 | .maxlen = sizeof(int), |
43 | .mode = 0644, | 42 | .mode = 0644, |
44 | .proc_handler = proc_dointvec_minmax, | 43 | .proc_handler = proc_dointvec_minmax, |
45 | .strategy = sysctl_intvec, | ||
46 | .extra1 = &min_quality, | 44 | .extra1 = &min_quality, |
47 | .extra2 = &max_quality | 45 | .extra2 = &max_quality |
48 | }, | 46 | }, |
49 | { | 47 | { |
50 | .ctl_name = NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, | ||
51 | .procname = "obsolescence_count_initialiser", | 48 | .procname = "obsolescence_count_initialiser", |
52 | .data = &sysctl_netrom_obsolescence_count_initialiser, | 49 | .data = &sysctl_netrom_obsolescence_count_initialiser, |
53 | .maxlen = sizeof(int), | 50 | .maxlen = sizeof(int), |
54 | .mode = 0644, | 51 | .mode = 0644, |
55 | .proc_handler = proc_dointvec_minmax, | 52 | .proc_handler = proc_dointvec_minmax, |
56 | .strategy = sysctl_intvec, | ||
57 | .extra1 = &min_obs, | 53 | .extra1 = &min_obs, |
58 | .extra2 = &max_obs | 54 | .extra2 = &max_obs |
59 | }, | 55 | }, |
60 | { | 56 | { |
61 | .ctl_name = NET_NETROM_NETWORK_TTL_INITIALISER, | ||
62 | .procname = "network_ttl_initialiser", | 57 | .procname = "network_ttl_initialiser", |
63 | .data = &sysctl_netrom_network_ttl_initialiser, | 58 | .data = &sysctl_netrom_network_ttl_initialiser, |
64 | .maxlen = sizeof(int), | 59 | .maxlen = sizeof(int), |
65 | .mode = 0644, | 60 | .mode = 0644, |
66 | .proc_handler = proc_dointvec_minmax, | 61 | .proc_handler = proc_dointvec_minmax, |
67 | .strategy = sysctl_intvec, | ||
68 | .extra1 = &min_ttl, | 62 | .extra1 = &min_ttl, |
69 | .extra2 = &max_ttl | 63 | .extra2 = &max_ttl |
70 | }, | 64 | }, |
71 | { | 65 | { |
72 | .ctl_name = NET_NETROM_TRANSPORT_TIMEOUT, | ||
73 | .procname = "transport_timeout", | 66 | .procname = "transport_timeout", |
74 | .data = &sysctl_netrom_transport_timeout, | 67 | .data = &sysctl_netrom_transport_timeout, |
75 | .maxlen = sizeof(int), | 68 | .maxlen = sizeof(int), |
76 | .mode = 0644, | 69 | .mode = 0644, |
77 | .proc_handler = proc_dointvec_minmax, | 70 | .proc_handler = proc_dointvec_minmax, |
78 | .strategy = sysctl_intvec, | ||
79 | .extra1 = &min_t1, | 71 | .extra1 = &min_t1, |
80 | .extra2 = &max_t1 | 72 | .extra2 = &max_t1 |
81 | }, | 73 | }, |
82 | { | 74 | { |
83 | .ctl_name = NET_NETROM_TRANSPORT_MAXIMUM_TRIES, | ||
84 | .procname = "transport_maximum_tries", | 75 | .procname = "transport_maximum_tries", |
85 | .data = &sysctl_netrom_transport_maximum_tries, | 76 | .data = &sysctl_netrom_transport_maximum_tries, |
86 | .maxlen = sizeof(int), | 77 | .maxlen = sizeof(int), |
87 | .mode = 0644, | 78 | .mode = 0644, |
88 | .proc_handler = proc_dointvec_minmax, | 79 | .proc_handler = proc_dointvec_minmax, |
89 | .strategy = sysctl_intvec, | ||
90 | .extra1 = &min_n2, | 80 | .extra1 = &min_n2, |
91 | .extra2 = &max_n2 | 81 | .extra2 = &max_n2 |
92 | }, | 82 | }, |
93 | { | 83 | { |
94 | .ctl_name = NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, | ||
95 | .procname = "transport_acknowledge_delay", | 84 | .procname = "transport_acknowledge_delay", |
96 | .data = &sysctl_netrom_transport_acknowledge_delay, | 85 | .data = &sysctl_netrom_transport_acknowledge_delay, |
97 | .maxlen = sizeof(int), | 86 | .maxlen = sizeof(int), |
98 | .mode = 0644, | 87 | .mode = 0644, |
99 | .proc_handler = proc_dointvec_minmax, | 88 | .proc_handler = proc_dointvec_minmax, |
100 | .strategy = sysctl_intvec, | ||
101 | .extra1 = &min_t2, | 89 | .extra1 = &min_t2, |
102 | .extra2 = &max_t2 | 90 | .extra2 = &max_t2 |
103 | }, | 91 | }, |
104 | { | 92 | { |
105 | .ctl_name = NET_NETROM_TRANSPORT_BUSY_DELAY, | ||
106 | .procname = "transport_busy_delay", | 93 | .procname = "transport_busy_delay", |
107 | .data = &sysctl_netrom_transport_busy_delay, | 94 | .data = &sysctl_netrom_transport_busy_delay, |
108 | .maxlen = sizeof(int), | 95 | .maxlen = sizeof(int), |
109 | .mode = 0644, | 96 | .mode = 0644, |
110 | .proc_handler = proc_dointvec_minmax, | 97 | .proc_handler = proc_dointvec_minmax, |
111 | .strategy = sysctl_intvec, | ||
112 | .extra1 = &min_t4, | 98 | .extra1 = &min_t4, |
113 | .extra2 = &max_t4 | 99 | .extra2 = &max_t4 |
114 | }, | 100 | }, |
115 | { | 101 | { |
116 | .ctl_name = NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, | ||
117 | .procname = "transport_requested_window_size", | 102 | .procname = "transport_requested_window_size", |
118 | .data = &sysctl_netrom_transport_requested_window_size, | 103 | .data = &sysctl_netrom_transport_requested_window_size, |
119 | .maxlen = sizeof(int), | 104 | .maxlen = sizeof(int), |
120 | .mode = 0644, | 105 | .mode = 0644, |
121 | .proc_handler = proc_dointvec_minmax, | 106 | .proc_handler = proc_dointvec_minmax, |
122 | .strategy = sysctl_intvec, | ||
123 | .extra1 = &min_window, | 107 | .extra1 = &min_window, |
124 | .extra2 = &max_window | 108 | .extra2 = &max_window |
125 | }, | 109 | }, |
126 | { | 110 | { |
127 | .ctl_name = NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, | ||
128 | .procname = "transport_no_activity_timeout", | 111 | .procname = "transport_no_activity_timeout", |
129 | .data = &sysctl_netrom_transport_no_activity_timeout, | 112 | .data = &sysctl_netrom_transport_no_activity_timeout, |
130 | .maxlen = sizeof(int), | 113 | .maxlen = sizeof(int), |
131 | .mode = 0644, | 114 | .mode = 0644, |
132 | .proc_handler = proc_dointvec_minmax, | 115 | .proc_handler = proc_dointvec_minmax, |
133 | .strategy = sysctl_intvec, | ||
134 | .extra1 = &min_idle, | 116 | .extra1 = &min_idle, |
135 | .extra2 = &max_idle | 117 | .extra2 = &max_idle |
136 | }, | 118 | }, |
137 | { | 119 | { |
138 | .ctl_name = NET_NETROM_ROUTING_CONTROL, | ||
139 | .procname = "routing_control", | 120 | .procname = "routing_control", |
140 | .data = &sysctl_netrom_routing_control, | 121 | .data = &sysctl_netrom_routing_control, |
141 | .maxlen = sizeof(int), | 122 | .maxlen = sizeof(int), |
142 | .mode = 0644, | 123 | .mode = 0644, |
143 | .proc_handler = proc_dointvec_minmax, | 124 | .proc_handler = proc_dointvec_minmax, |
144 | .strategy = sysctl_intvec, | ||
145 | .extra1 = &min_route, | 125 | .extra1 = &min_route, |
146 | .extra2 = &max_route | 126 | .extra2 = &max_route |
147 | }, | 127 | }, |
148 | { | 128 | { |
149 | .ctl_name = NET_NETROM_LINK_FAILS_COUNT, | ||
150 | .procname = "link_fails_count", | 129 | .procname = "link_fails_count", |
151 | .data = &sysctl_netrom_link_fails_count, | 130 | .data = &sysctl_netrom_link_fails_count, |
152 | .maxlen = sizeof(int), | 131 | .maxlen = sizeof(int), |
153 | .mode = 0644, | 132 | .mode = 0644, |
154 | .proc_handler = proc_dointvec_minmax, | 133 | .proc_handler = proc_dointvec_minmax, |
155 | .strategy = sysctl_intvec, | ||
156 | .extra1 = &min_fails, | 134 | .extra1 = &min_fails, |
157 | .extra2 = &max_fails | 135 | .extra2 = &max_fails |
158 | }, | 136 | }, |
159 | { | 137 | { |
160 | .ctl_name = NET_NETROM_RESET, | ||
161 | .procname = "reset", | 138 | .procname = "reset", |
162 | .data = &sysctl_netrom_reset_circuit, | 139 | .data = &sysctl_netrom_reset_circuit, |
163 | .maxlen = sizeof(int), | 140 | .maxlen = sizeof(int), |
164 | .mode = 0644, | 141 | .mode = 0644, |
165 | .proc_handler = proc_dointvec_minmax, | 142 | .proc_handler = proc_dointvec_minmax, |
166 | .strategy = sysctl_intvec, | ||
167 | .extra1 = &min_reset, | 143 | .extra1 = &min_reset, |
168 | .extra2 = &max_reset | 144 | .extra2 = &max_reset |
169 | }, | 145 | }, |
170 | { .ctl_name = 0 } | 146 | { } |
171 | }; | 147 | }; |
172 | 148 | ||
173 | static struct ctl_path nr_path[] = { | 149 | static struct ctl_path nr_path[] = { |
174 | { .procname = "net", .ctl_name = CTL_NET, }, | 150 | { .procname = "net", }, |
175 | { .procname = "netrom", .ctl_name = NET_NETROM, }, | 151 | { .procname = "netrom", }, |
176 | { } | 152 | { } |
177 | }; | 153 | }; |
178 | 154 | ||
diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c index 2220f3322326..cea1c7dbdae2 100644 --- a/net/phonet/sysctl.c +++ b/net/phonet/sysctl.c | |||
@@ -84,20 +84,18 @@ static int proc_local_port_range(ctl_table *table, int write, | |||
84 | 84 | ||
85 | static struct ctl_table phonet_table[] = { | 85 | static struct ctl_table phonet_table[] = { |
86 | { | 86 | { |
87 | .ctl_name = CTL_UNNUMBERED, | ||
88 | .procname = "local_port_range", | 87 | .procname = "local_port_range", |
89 | .data = &local_port_range, | 88 | .data = &local_port_range, |
90 | .maxlen = sizeof(local_port_range), | 89 | .maxlen = sizeof(local_port_range), |
91 | .mode = 0644, | 90 | .mode = 0644, |
92 | .proc_handler = proc_local_port_range, | 91 | .proc_handler = proc_local_port_range, |
93 | .strategy = NULL, | ||
94 | }, | 92 | }, |
95 | { .ctl_name = 0 } | 93 | { } |
96 | }; | 94 | }; |
97 | 95 | ||
98 | static struct ctl_path phonet_ctl_path[] = { | 96 | static struct ctl_path phonet_ctl_path[] = { |
99 | { .procname = "net", .ctl_name = CTL_NET, }, | 97 | { .procname = "net", }, |
100 | { .procname = "phonet", .ctl_name = CTL_UNNUMBERED, }, | 98 | { .procname = "phonet", }, |
101 | { }, | 99 | { }, |
102 | }; | 100 | }; |
103 | 101 | ||
diff --git a/net/rds/ib_sysctl.c b/net/rds/ib_sysctl.c index 84b5ffcb280f..03f01cb4e0fe 100644 --- a/net/rds/ib_sysctl.c +++ b/net/rds/ib_sysctl.c | |||
@@ -67,68 +67,62 @@ unsigned int rds_ib_sysctl_flow_control = 0; | |||
67 | 67 | ||
68 | ctl_table rds_ib_sysctl_table[] = { | 68 | ctl_table rds_ib_sysctl_table[] = { |
69 | { | 69 | { |
70 | .ctl_name = CTL_UNNUMBERED, | ||
71 | .procname = "max_send_wr", | 70 | .procname = "max_send_wr", |
72 | .data = &rds_ib_sysctl_max_send_wr, | 71 | .data = &rds_ib_sysctl_max_send_wr, |
73 | .maxlen = sizeof(unsigned long), | 72 | .maxlen = sizeof(unsigned long), |
74 | .mode = 0644, | 73 | .mode = 0644, |
75 | .proc_handler = &proc_doulongvec_minmax, | 74 | .proc_handler = proc_doulongvec_minmax, |
76 | .extra1 = &rds_ib_sysctl_max_wr_min, | 75 | .extra1 = &rds_ib_sysctl_max_wr_min, |
77 | .extra2 = &rds_ib_sysctl_max_wr_max, | 76 | .extra2 = &rds_ib_sysctl_max_wr_max, |
78 | }, | 77 | }, |
79 | { | 78 | { |
80 | .ctl_name = CTL_UNNUMBERED, | ||
81 | .procname = "max_recv_wr", | 79 | .procname = "max_recv_wr", |
82 | .data = &rds_ib_sysctl_max_recv_wr, | 80 | .data = &rds_ib_sysctl_max_recv_wr, |
83 | .maxlen = sizeof(unsigned long), | 81 | .maxlen = sizeof(unsigned long), |
84 | .mode = 0644, | 82 | .mode = 0644, |
85 | .proc_handler = &proc_doulongvec_minmax, | 83 | .proc_handler = proc_doulongvec_minmax, |
86 | .extra1 = &rds_ib_sysctl_max_wr_min, | 84 | .extra1 = &rds_ib_sysctl_max_wr_min, |
87 | .extra2 = &rds_ib_sysctl_max_wr_max, | 85 | .extra2 = &rds_ib_sysctl_max_wr_max, |
88 | }, | 86 | }, |
89 | { | 87 | { |
90 | .ctl_name = CTL_UNNUMBERED, | ||
91 | .procname = "max_unsignaled_wr", | 88 | .procname = "max_unsignaled_wr", |
92 | .data = &rds_ib_sysctl_max_unsig_wrs, | 89 | .data = &rds_ib_sysctl_max_unsig_wrs, |
93 | .maxlen = sizeof(unsigned long), | 90 | .maxlen = sizeof(unsigned long), |
94 | .mode = 0644, | 91 | .mode = 0644, |
95 | .proc_handler = &proc_doulongvec_minmax, | 92 | .proc_handler = proc_doulongvec_minmax, |
96 | .extra1 = &rds_ib_sysctl_max_unsig_wr_min, | 93 | .extra1 = &rds_ib_sysctl_max_unsig_wr_min, |
97 | .extra2 = &rds_ib_sysctl_max_unsig_wr_max, | 94 | .extra2 = &rds_ib_sysctl_max_unsig_wr_max, |
98 | }, | 95 | }, |
99 | { | 96 | { |
100 | .ctl_name = CTL_UNNUMBERED, | ||
101 | .procname = "max_unsignaled_bytes", | 97 | .procname = "max_unsignaled_bytes", |
102 | .data = &rds_ib_sysctl_max_unsig_bytes, | 98 | .data = &rds_ib_sysctl_max_unsig_bytes, |
103 | .maxlen = sizeof(unsigned long), | 99 | .maxlen = sizeof(unsigned long), |
104 | .mode = 0644, | 100 | .mode = 0644, |
105 | .proc_handler = &proc_doulongvec_minmax, | 101 | .proc_handler = proc_doulongvec_minmax, |
106 | .extra1 = &rds_ib_sysctl_max_unsig_bytes_min, | 102 | .extra1 = &rds_ib_sysctl_max_unsig_bytes_min, |
107 | .extra2 = &rds_ib_sysctl_max_unsig_bytes_max, | 103 | .extra2 = &rds_ib_sysctl_max_unsig_bytes_max, |
108 | }, | 104 | }, |
109 | { | 105 | { |
110 | .ctl_name = CTL_UNNUMBERED, | ||
111 | .procname = "max_recv_allocation", | 106 | .procname = "max_recv_allocation", |
112 | .data = &rds_ib_sysctl_max_recv_allocation, | 107 | .data = &rds_ib_sysctl_max_recv_allocation, |
113 | .maxlen = sizeof(unsigned long), | 108 | .maxlen = sizeof(unsigned long), |
114 | .mode = 0644, | 109 | .mode = 0644, |
115 | .proc_handler = &proc_doulongvec_minmax, | 110 | .proc_handler = proc_doulongvec_minmax, |
116 | }, | 111 | }, |
117 | { | 112 | { |
118 | .ctl_name = CTL_UNNUMBERED, | ||
119 | .procname = "flow_control", | 113 | .procname = "flow_control", |
120 | .data = &rds_ib_sysctl_flow_control, | 114 | .data = &rds_ib_sysctl_flow_control, |
121 | .maxlen = sizeof(rds_ib_sysctl_flow_control), | 115 | .maxlen = sizeof(rds_ib_sysctl_flow_control), |
122 | .mode = 0644, | 116 | .mode = 0644, |
123 | .proc_handler = &proc_dointvec, | 117 | .proc_handler = proc_dointvec, |
124 | }, | 118 | }, |
125 | { .ctl_name = 0} | 119 | { } |
126 | }; | 120 | }; |
127 | 121 | ||
128 | static struct ctl_path rds_ib_sysctl_path[] = { | 122 | static struct ctl_path rds_ib_sysctl_path[] = { |
129 | { .procname = "net", .ctl_name = CTL_NET, }, | 123 | { .procname = "net", }, |
130 | { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, | 124 | { .procname = "rds", }, |
131 | { .procname = "ib", .ctl_name = CTL_UNNUMBERED, }, | 125 | { .procname = "ib", }, |
132 | { } | 126 | { } |
133 | }; | 127 | }; |
134 | 128 | ||
diff --git a/net/rds/iw_sysctl.c b/net/rds/iw_sysctl.c index 9590678cd616..1c4428a61a02 100644 --- a/net/rds/iw_sysctl.c +++ b/net/rds/iw_sysctl.c | |||
@@ -57,68 +57,62 @@ unsigned int rds_iw_sysctl_flow_control = 1; | |||
57 | 57 | ||
58 | ctl_table rds_iw_sysctl_table[] = { | 58 | ctl_table rds_iw_sysctl_table[] = { |
59 | { | 59 | { |
60 | .ctl_name = CTL_UNNUMBERED, | ||
61 | .procname = "max_send_wr", | 60 | .procname = "max_send_wr", |
62 | .data = &rds_iw_sysctl_max_send_wr, | 61 | .data = &rds_iw_sysctl_max_send_wr, |
63 | .maxlen = sizeof(unsigned long), | 62 | .maxlen = sizeof(unsigned long), |
64 | .mode = 0644, | 63 | .mode = 0644, |
65 | .proc_handler = &proc_doulongvec_minmax, | 64 | .proc_handler = proc_doulongvec_minmax, |
66 | .extra1 = &rds_iw_sysctl_max_wr_min, | 65 | .extra1 = &rds_iw_sysctl_max_wr_min, |
67 | .extra2 = &rds_iw_sysctl_max_wr_max, | 66 | .extra2 = &rds_iw_sysctl_max_wr_max, |
68 | }, | 67 | }, |
69 | { | 68 | { |
70 | .ctl_name = CTL_UNNUMBERED, | ||
71 | .procname = "max_recv_wr", | 69 | .procname = "max_recv_wr", |
72 | .data = &rds_iw_sysctl_max_recv_wr, | 70 | .data = &rds_iw_sysctl_max_recv_wr, |
73 | .maxlen = sizeof(unsigned long), | 71 | .maxlen = sizeof(unsigned long), |
74 | .mode = 0644, | 72 | .mode = 0644, |
75 | .proc_handler = &proc_doulongvec_minmax, | 73 | .proc_handler = proc_doulongvec_minmax, |
76 | .extra1 = &rds_iw_sysctl_max_wr_min, | 74 | .extra1 = &rds_iw_sysctl_max_wr_min, |
77 | .extra2 = &rds_iw_sysctl_max_wr_max, | 75 | .extra2 = &rds_iw_sysctl_max_wr_max, |
78 | }, | 76 | }, |
79 | { | 77 | { |
80 | .ctl_name = CTL_UNNUMBERED, | ||
81 | .procname = "max_unsignaled_wr", | 78 | .procname = "max_unsignaled_wr", |
82 | .data = &rds_iw_sysctl_max_unsig_wrs, | 79 | .data = &rds_iw_sysctl_max_unsig_wrs, |
83 | .maxlen = sizeof(unsigned long), | 80 | .maxlen = sizeof(unsigned long), |
84 | .mode = 0644, | 81 | .mode = 0644, |
85 | .proc_handler = &proc_doulongvec_minmax, | 82 | .proc_handler = proc_doulongvec_minmax, |
86 | .extra1 = &rds_iw_sysctl_max_unsig_wr_min, | 83 | .extra1 = &rds_iw_sysctl_max_unsig_wr_min, |
87 | .extra2 = &rds_iw_sysctl_max_unsig_wr_max, | 84 | .extra2 = &rds_iw_sysctl_max_unsig_wr_max, |
88 | }, | 85 | }, |
89 | { | 86 | { |
90 | .ctl_name = CTL_UNNUMBERED, | ||
91 | .procname = "max_unsignaled_bytes", | 87 | .procname = "max_unsignaled_bytes", |
92 | .data = &rds_iw_sysctl_max_unsig_bytes, | 88 | .data = &rds_iw_sysctl_max_unsig_bytes, |
93 | .maxlen = sizeof(unsigned long), | 89 | .maxlen = sizeof(unsigned long), |
94 | .mode = 0644, | 90 | .mode = 0644, |
95 | .proc_handler = &proc_doulongvec_minmax, | 91 | .proc_handler = proc_doulongvec_minmax, |
96 | .extra1 = &rds_iw_sysctl_max_unsig_bytes_min, | 92 | .extra1 = &rds_iw_sysctl_max_unsig_bytes_min, |
97 | .extra2 = &rds_iw_sysctl_max_unsig_bytes_max, | 93 | .extra2 = &rds_iw_sysctl_max_unsig_bytes_max, |
98 | }, | 94 | }, |
99 | { | 95 | { |
100 | .ctl_name = CTL_UNNUMBERED, | ||
101 | .procname = "max_recv_allocation", | 96 | .procname = "max_recv_allocation", |
102 | .data = &rds_iw_sysctl_max_recv_allocation, | 97 | .data = &rds_iw_sysctl_max_recv_allocation, |
103 | .maxlen = sizeof(unsigned long), | 98 | .maxlen = sizeof(unsigned long), |
104 | .mode = 0644, | 99 | .mode = 0644, |
105 | .proc_handler = &proc_doulongvec_minmax, | 100 | .proc_handler = proc_doulongvec_minmax, |
106 | }, | 101 | }, |
107 | { | 102 | { |
108 | .ctl_name = CTL_UNNUMBERED, | ||
109 | .procname = "flow_control", | 103 | .procname = "flow_control", |
110 | .data = &rds_iw_sysctl_flow_control, | 104 | .data = &rds_iw_sysctl_flow_control, |
111 | .maxlen = sizeof(rds_iw_sysctl_flow_control), | 105 | .maxlen = sizeof(rds_iw_sysctl_flow_control), |
112 | .mode = 0644, | 106 | .mode = 0644, |
113 | .proc_handler = &proc_dointvec, | 107 | .proc_handler = proc_dointvec, |
114 | }, | 108 | }, |
115 | { .ctl_name = 0} | 109 | { } |
116 | }; | 110 | }; |
117 | 111 | ||
118 | static struct ctl_path rds_iw_sysctl_path[] = { | 112 | static struct ctl_path rds_iw_sysctl_path[] = { |
119 | { .procname = "net", .ctl_name = CTL_NET, }, | 113 | { .procname = "net", }, |
120 | { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, | 114 | { .procname = "rds", }, |
121 | { .procname = "iw", .ctl_name = CTL_UNNUMBERED, }, | 115 | { .procname = "iw", }, |
122 | { } | 116 | { } |
123 | }; | 117 | }; |
124 | 118 | ||
diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c index 307dc5c1be15..7829a20325d3 100644 --- a/net/rds/sysctl.c +++ b/net/rds/sysctl.c | |||
@@ -51,55 +51,50 @@ unsigned int rds_sysctl_ping_enable = 1; | |||
51 | 51 | ||
52 | static ctl_table rds_sysctl_rds_table[] = { | 52 | static ctl_table rds_sysctl_rds_table[] = { |
53 | { | 53 | { |
54 | .ctl_name = CTL_UNNUMBERED, | ||
55 | .procname = "reconnect_min_delay_ms", | 54 | .procname = "reconnect_min_delay_ms", |
56 | .data = &rds_sysctl_reconnect_min_jiffies, | 55 | .data = &rds_sysctl_reconnect_min_jiffies, |
57 | .maxlen = sizeof(unsigned long), | 56 | .maxlen = sizeof(unsigned long), |
58 | .mode = 0644, | 57 | .mode = 0644, |
59 | .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | 58 | .proc_handler = proc_doulongvec_ms_jiffies_minmax, |
60 | .extra1 = &rds_sysctl_reconnect_min, | 59 | .extra1 = &rds_sysctl_reconnect_min, |
61 | .extra2 = &rds_sysctl_reconnect_max_jiffies, | 60 | .extra2 = &rds_sysctl_reconnect_max_jiffies, |
62 | }, | 61 | }, |
63 | { | 62 | { |
64 | .ctl_name = CTL_UNNUMBERED, | ||
65 | .procname = "reconnect_max_delay_ms", | 63 | .procname = "reconnect_max_delay_ms", |
66 | .data = &rds_sysctl_reconnect_max_jiffies, | 64 | .data = &rds_sysctl_reconnect_max_jiffies, |
67 | .maxlen = sizeof(unsigned long), | 65 | .maxlen = sizeof(unsigned long), |
68 | .mode = 0644, | 66 | .mode = 0644, |
69 | .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | 67 | .proc_handler = proc_doulongvec_ms_jiffies_minmax, |
70 | .extra1 = &rds_sysctl_reconnect_min_jiffies, | 68 | .extra1 = &rds_sysctl_reconnect_min_jiffies, |
71 | .extra2 = &rds_sysctl_reconnect_max, | 69 | .extra2 = &rds_sysctl_reconnect_max, |
72 | }, | 70 | }, |
73 | { | 71 | { |
74 | .ctl_name = CTL_UNNUMBERED, | ||
75 | .procname = "max_unacked_packets", | 72 | .procname = "max_unacked_packets", |
76 | .data = &rds_sysctl_max_unacked_packets, | 73 | .data = &rds_sysctl_max_unacked_packets, |
77 | .maxlen = sizeof(unsigned long), | 74 | .maxlen = sizeof(unsigned long), |
78 | .mode = 0644, | 75 | .mode = 0644, |
79 | .proc_handler = &proc_dointvec, | 76 | .proc_handler = proc_dointvec, |
80 | }, | 77 | }, |
81 | { | 78 | { |
82 | .ctl_name = CTL_UNNUMBERED, | ||
83 | .procname = "max_unacked_bytes", | 79 | .procname = "max_unacked_bytes", |
84 | .data = &rds_sysctl_max_unacked_bytes, | 80 | .data = &rds_sysctl_max_unacked_bytes, |
85 | .maxlen = sizeof(unsigned long), | 81 | .maxlen = sizeof(unsigned long), |
86 | .mode = 0644, | 82 | .mode = 0644, |
87 | .proc_handler = &proc_dointvec, | 83 | .proc_handler = proc_dointvec, |
88 | }, | 84 | }, |
89 | { | 85 | { |
90 | .ctl_name = CTL_UNNUMBERED, | ||
91 | .procname = "ping_enable", | 86 | .procname = "ping_enable", |
92 | .data = &rds_sysctl_ping_enable, | 87 | .data = &rds_sysctl_ping_enable, |
93 | .maxlen = sizeof(int), | 88 | .maxlen = sizeof(int), |
94 | .mode = 0644, | 89 | .mode = 0644, |
95 | .proc_handler = &proc_dointvec, | 90 | .proc_handler = proc_dointvec, |
96 | }, | 91 | }, |
97 | { .ctl_name = 0} | 92 | { } |
98 | }; | 93 | }; |
99 | 94 | ||
100 | static struct ctl_path rds_sysctl_path[] = { | 95 | static struct ctl_path rds_sysctl_path[] = { |
101 | { .procname = "net", .ctl_name = CTL_NET, }, | 96 | { .procname = "net", }, |
102 | { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, | 97 | { .procname = "rds", }, |
103 | { } | 98 | { } |
104 | }; | 99 | }; |
105 | 100 | ||
diff --git a/net/rose/sysctl_net_rose.c b/net/rose/sysctl_net_rose.c index 3bfe504faf86..df6d9dac2186 100644 --- a/net/rose/sysctl_net_rose.c +++ b/net/rose/sysctl_net_rose.c | |||
@@ -26,121 +26,101 @@ static struct ctl_table_header *rose_table_header; | |||
26 | 26 | ||
27 | static ctl_table rose_table[] = { | 27 | static ctl_table rose_table[] = { |
28 | { | 28 | { |
29 | .ctl_name = NET_ROSE_RESTART_REQUEST_TIMEOUT, | ||
30 | .procname = "restart_request_timeout", | 29 | .procname = "restart_request_timeout", |
31 | .data = &sysctl_rose_restart_request_timeout, | 30 | .data = &sysctl_rose_restart_request_timeout, |
32 | .maxlen = sizeof(int), | 31 | .maxlen = sizeof(int), |
33 | .mode = 0644, | 32 | .mode = 0644, |
34 | .proc_handler = proc_dointvec_minmax, | 33 | .proc_handler = proc_dointvec_minmax, |
35 | .strategy = sysctl_intvec, | ||
36 | .extra1 = &min_timer, | 34 | .extra1 = &min_timer, |
37 | .extra2 = &max_timer | 35 | .extra2 = &max_timer |
38 | }, | 36 | }, |
39 | { | 37 | { |
40 | .ctl_name = NET_ROSE_CALL_REQUEST_TIMEOUT, | ||
41 | .procname = "call_request_timeout", | 38 | .procname = "call_request_timeout", |
42 | .data = &sysctl_rose_call_request_timeout, | 39 | .data = &sysctl_rose_call_request_timeout, |
43 | .maxlen = sizeof(int), | 40 | .maxlen = sizeof(int), |
44 | .mode = 0644, | 41 | .mode = 0644, |
45 | .proc_handler = proc_dointvec_minmax, | 42 | .proc_handler = proc_dointvec_minmax, |
46 | .strategy = sysctl_intvec, | ||
47 | .extra1 = &min_timer, | 43 | .extra1 = &min_timer, |
48 | .extra2 = &max_timer | 44 | .extra2 = &max_timer |
49 | }, | 45 | }, |
50 | { | 46 | { |
51 | .ctl_name = NET_ROSE_RESET_REQUEST_TIMEOUT, | ||
52 | .procname = "reset_request_timeout", | 47 | .procname = "reset_request_timeout", |
53 | .data = &sysctl_rose_reset_request_timeout, | 48 | .data = &sysctl_rose_reset_request_timeout, |
54 | .maxlen = sizeof(int), | 49 | .maxlen = sizeof(int), |
55 | .mode = 0644, | 50 | .mode = 0644, |
56 | .proc_handler = proc_dointvec_minmax, | 51 | .proc_handler = proc_dointvec_minmax, |
57 | .strategy = sysctl_intvec, | ||
58 | .extra1 = &min_timer, | 52 | .extra1 = &min_timer, |
59 | .extra2 = &max_timer | 53 | .extra2 = &max_timer |
60 | }, | 54 | }, |
61 | { | 55 | { |
62 | .ctl_name = NET_ROSE_CLEAR_REQUEST_TIMEOUT, | ||
63 | .procname = "clear_request_timeout", | 56 | .procname = "clear_request_timeout", |
64 | .data = &sysctl_rose_clear_request_timeout, | 57 | .data = &sysctl_rose_clear_request_timeout, |
65 | .maxlen = sizeof(int), | 58 | .maxlen = sizeof(int), |
66 | .mode = 0644, | 59 | .mode = 0644, |
67 | .proc_handler = proc_dointvec_minmax, | 60 | .proc_handler = proc_dointvec_minmax, |
68 | .strategy = sysctl_intvec, | ||
69 | .extra1 = &min_timer, | 61 | .extra1 = &min_timer, |
70 | .extra2 = &max_timer | 62 | .extra2 = &max_timer |
71 | }, | 63 | }, |
72 | { | 64 | { |
73 | .ctl_name = NET_ROSE_NO_ACTIVITY_TIMEOUT, | ||
74 | .procname = "no_activity_timeout", | 65 | .procname = "no_activity_timeout", |
75 | .data = &sysctl_rose_no_activity_timeout, | 66 | .data = &sysctl_rose_no_activity_timeout, |
76 | .maxlen = sizeof(int), | 67 | .maxlen = sizeof(int), |
77 | .mode = 0644, | 68 | .mode = 0644, |
78 | .proc_handler = proc_dointvec_minmax, | 69 | .proc_handler = proc_dointvec_minmax, |
79 | .strategy = sysctl_intvec, | ||
80 | .extra1 = &min_idle, | 70 | .extra1 = &min_idle, |
81 | .extra2 = &max_idle | 71 | .extra2 = &max_idle |
82 | }, | 72 | }, |
83 | { | 73 | { |
84 | .ctl_name = NET_ROSE_ACK_HOLD_BACK_TIMEOUT, | ||
85 | .procname = "acknowledge_hold_back_timeout", | 74 | .procname = "acknowledge_hold_back_timeout", |
86 | .data = &sysctl_rose_ack_hold_back_timeout, | 75 | .data = &sysctl_rose_ack_hold_back_timeout, |
87 | .maxlen = sizeof(int), | 76 | .maxlen = sizeof(int), |
88 | .mode = 0644, | 77 | .mode = 0644, |
89 | .proc_handler = proc_dointvec_minmax, | 78 | .proc_handler = proc_dointvec_minmax, |
90 | .strategy = sysctl_intvec, | ||
91 | .extra1 = &min_timer, | 79 | .extra1 = &min_timer, |
92 | .extra2 = &max_timer | 80 | .extra2 = &max_timer |
93 | }, | 81 | }, |
94 | { | 82 | { |
95 | .ctl_name = NET_ROSE_ROUTING_CONTROL, | ||
96 | .procname = "routing_control", | 83 | .procname = "routing_control", |
97 | .data = &sysctl_rose_routing_control, | 84 | .data = &sysctl_rose_routing_control, |
98 | .maxlen = sizeof(int), | 85 | .maxlen = sizeof(int), |
99 | .mode = 0644, | 86 | .mode = 0644, |
100 | .proc_handler = proc_dointvec_minmax, | 87 | .proc_handler = proc_dointvec_minmax, |
101 | .strategy = sysctl_intvec, | ||
102 | .extra1 = &min_route, | 88 | .extra1 = &min_route, |
103 | .extra2 = &max_route | 89 | .extra2 = &max_route |
104 | }, | 90 | }, |
105 | { | 91 | { |
106 | .ctl_name = NET_ROSE_LINK_FAIL_TIMEOUT, | ||
107 | .procname = "link_fail_timeout", | 92 | .procname = "link_fail_timeout", |
108 | .data = &sysctl_rose_link_fail_timeout, | 93 | .data = &sysctl_rose_link_fail_timeout, |
109 | .maxlen = sizeof(int), | 94 | .maxlen = sizeof(int), |
110 | .mode = 0644, | 95 | .mode = 0644, |
111 | .proc_handler = proc_dointvec_minmax, | 96 | .proc_handler = proc_dointvec_minmax, |
112 | .strategy = sysctl_intvec, | ||
113 | .extra1 = &min_ftimer, | 97 | .extra1 = &min_ftimer, |
114 | .extra2 = &max_ftimer | 98 | .extra2 = &max_ftimer |
115 | }, | 99 | }, |
116 | { | 100 | { |
117 | .ctl_name = NET_ROSE_MAX_VCS, | ||
118 | .procname = "maximum_virtual_circuits", | 101 | .procname = "maximum_virtual_circuits", |
119 | .data = &sysctl_rose_maximum_vcs, | 102 | .data = &sysctl_rose_maximum_vcs, |
120 | .maxlen = sizeof(int), | 103 | .maxlen = sizeof(int), |
121 | .mode = 0644, | 104 | .mode = 0644, |
122 | .proc_handler = proc_dointvec_minmax, | 105 | .proc_handler = proc_dointvec_minmax, |
123 | .strategy = sysctl_intvec, | ||
124 | .extra1 = &min_maxvcs, | 106 | .extra1 = &min_maxvcs, |
125 | .extra2 = &max_maxvcs | 107 | .extra2 = &max_maxvcs |
126 | }, | 108 | }, |
127 | { | 109 | { |
128 | .ctl_name = NET_ROSE_WINDOW_SIZE, | ||
129 | .procname = "window_size", | 110 | .procname = "window_size", |
130 | .data = &sysctl_rose_window_size, | 111 | .data = &sysctl_rose_window_size, |
131 | .maxlen = sizeof(int), | 112 | .maxlen = sizeof(int), |
132 | .mode = 0644, | 113 | .mode = 0644, |
133 | .proc_handler = proc_dointvec_minmax, | 114 | .proc_handler = proc_dointvec_minmax, |
134 | .strategy = sysctl_intvec, | ||
135 | .extra1 = &min_window, | 115 | .extra1 = &min_window, |
136 | .extra2 = &max_window | 116 | .extra2 = &max_window |
137 | }, | 117 | }, |
138 | { .ctl_name = 0 } | 118 | { } |
139 | }; | 119 | }; |
140 | 120 | ||
141 | static struct ctl_path rose_path[] = { | 121 | static struct ctl_path rose_path[] = { |
142 | { .procname = "net", .ctl_name = CTL_NET, }, | 122 | { .procname = "net", }, |
143 | { .procname = "rose", .ctl_name = NET_ROSE, }, | 123 | { .procname = "rose", }, |
144 | { } | 124 | { } |
145 | }; | 125 | }; |
146 | 126 | ||
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index ab7151da120f..d50a042f9552 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c | |||
@@ -59,180 +59,145 @@ extern int sysctl_sctp_wmem[3]; | |||
59 | 59 | ||
60 | static ctl_table sctp_table[] = { | 60 | static ctl_table sctp_table[] = { |
61 | { | 61 | { |
62 | .ctl_name = NET_SCTP_RTO_INITIAL, | ||
63 | .procname = "rto_initial", | 62 | .procname = "rto_initial", |
64 | .data = &sctp_rto_initial, | 63 | .data = &sctp_rto_initial, |
65 | .maxlen = sizeof(unsigned int), | 64 | .maxlen = sizeof(unsigned int), |
66 | .mode = 0644, | 65 | .mode = 0644, |
67 | .proc_handler = proc_dointvec_minmax, | 66 | .proc_handler = proc_dointvec_minmax, |
68 | .strategy = sysctl_intvec, | ||
69 | .extra1 = &one, | 67 | .extra1 = &one, |
70 | .extra2 = &timer_max | 68 | .extra2 = &timer_max |
71 | }, | 69 | }, |
72 | { | 70 | { |
73 | .ctl_name = NET_SCTP_RTO_MIN, | ||
74 | .procname = "rto_min", | 71 | .procname = "rto_min", |
75 | .data = &sctp_rto_min, | 72 | .data = &sctp_rto_min, |
76 | .maxlen = sizeof(unsigned int), | 73 | .maxlen = sizeof(unsigned int), |
77 | .mode = 0644, | 74 | .mode = 0644, |
78 | .proc_handler = proc_dointvec_minmax, | 75 | .proc_handler = proc_dointvec_minmax, |
79 | .strategy = sysctl_intvec, | ||
80 | .extra1 = &one, | 76 | .extra1 = &one, |
81 | .extra2 = &timer_max | 77 | .extra2 = &timer_max |
82 | }, | 78 | }, |
83 | { | 79 | { |
84 | .ctl_name = NET_SCTP_RTO_MAX, | ||
85 | .procname = "rto_max", | 80 | .procname = "rto_max", |
86 | .data = &sctp_rto_max, | 81 | .data = &sctp_rto_max, |
87 | .maxlen = sizeof(unsigned int), | 82 | .maxlen = sizeof(unsigned int), |
88 | .mode = 0644, | 83 | .mode = 0644, |
89 | .proc_handler = proc_dointvec_minmax, | 84 | .proc_handler = proc_dointvec_minmax, |
90 | .strategy = sysctl_intvec, | ||
91 | .extra1 = &one, | 85 | .extra1 = &one, |
92 | .extra2 = &timer_max | 86 | .extra2 = &timer_max |
93 | }, | 87 | }, |
94 | { | 88 | { |
95 | .ctl_name = NET_SCTP_VALID_COOKIE_LIFE, | ||
96 | .procname = "valid_cookie_life", | 89 | .procname = "valid_cookie_life", |
97 | .data = &sctp_valid_cookie_life, | 90 | .data = &sctp_valid_cookie_life, |
98 | .maxlen = sizeof(unsigned int), | 91 | .maxlen = sizeof(unsigned int), |
99 | .mode = 0644, | 92 | .mode = 0644, |
100 | .proc_handler = proc_dointvec_minmax, | 93 | .proc_handler = proc_dointvec_minmax, |
101 | .strategy = sysctl_intvec, | ||
102 | .extra1 = &one, | 94 | .extra1 = &one, |
103 | .extra2 = &timer_max | 95 | .extra2 = &timer_max |
104 | }, | 96 | }, |
105 | { | 97 | { |
106 | .ctl_name = NET_SCTP_MAX_BURST, | ||
107 | .procname = "max_burst", | 98 | .procname = "max_burst", |
108 | .data = &sctp_max_burst, | 99 | .data = &sctp_max_burst, |
109 | .maxlen = sizeof(int), | 100 | .maxlen = sizeof(int), |
110 | .mode = 0644, | 101 | .mode = 0644, |
111 | .proc_handler = proc_dointvec_minmax, | 102 | .proc_handler = proc_dointvec_minmax, |
112 | .strategy = sysctl_intvec, | ||
113 | .extra1 = &zero, | 103 | .extra1 = &zero, |
114 | .extra2 = &int_max | 104 | .extra2 = &int_max |
115 | }, | 105 | }, |
116 | { | 106 | { |
117 | .ctl_name = NET_SCTP_ASSOCIATION_MAX_RETRANS, | ||
118 | .procname = "association_max_retrans", | 107 | .procname = "association_max_retrans", |
119 | .data = &sctp_max_retrans_association, | 108 | .data = &sctp_max_retrans_association, |
120 | .maxlen = sizeof(int), | 109 | .maxlen = sizeof(int), |
121 | .mode = 0644, | 110 | .mode = 0644, |
122 | .proc_handler = proc_dointvec_minmax, | 111 | .proc_handler = proc_dointvec_minmax, |
123 | .strategy = sysctl_intvec, | ||
124 | .extra1 = &one, | 112 | .extra1 = &one, |
125 | .extra2 = &int_max | 113 | .extra2 = &int_max |
126 | }, | 114 | }, |
127 | { | 115 | { |
128 | .ctl_name = NET_SCTP_SNDBUF_POLICY, | ||
129 | .procname = "sndbuf_policy", | 116 | .procname = "sndbuf_policy", |
130 | .data = &sctp_sndbuf_policy, | 117 | .data = &sctp_sndbuf_policy, |
131 | .maxlen = sizeof(int), | 118 | .maxlen = sizeof(int), |
132 | .mode = 0644, | 119 | .mode = 0644, |
133 | .proc_handler = proc_dointvec, | 120 | .proc_handler = proc_dointvec, |
134 | .strategy = sysctl_intvec | ||
135 | }, | 121 | }, |
136 | { | 122 | { |
137 | .ctl_name = NET_SCTP_RCVBUF_POLICY, | ||
138 | .procname = "rcvbuf_policy", | 123 | .procname = "rcvbuf_policy", |
139 | .data = &sctp_rcvbuf_policy, | 124 | .data = &sctp_rcvbuf_policy, |
140 | .maxlen = sizeof(int), | 125 | .maxlen = sizeof(int), |
141 | .mode = 0644, | 126 | .mode = 0644, |
142 | .proc_handler = proc_dointvec, | 127 | .proc_handler = proc_dointvec, |
143 | .strategy = sysctl_intvec | ||
144 | }, | 128 | }, |
145 | { | 129 | { |
146 | .ctl_name = NET_SCTP_PATH_MAX_RETRANS, | ||
147 | .procname = "path_max_retrans", | 130 | .procname = "path_max_retrans", |
148 | .data = &sctp_max_retrans_path, | 131 | .data = &sctp_max_retrans_path, |
149 | .maxlen = sizeof(int), | 132 | .maxlen = sizeof(int), |
150 | .mode = 0644, | 133 | .mode = 0644, |
151 | .proc_handler = proc_dointvec_minmax, | 134 | .proc_handler = proc_dointvec_minmax, |
152 | .strategy = sysctl_intvec, | ||
153 | .extra1 = &one, | 135 | .extra1 = &one, |
154 | .extra2 = &int_max | 136 | .extra2 = &int_max |
155 | }, | 137 | }, |
156 | { | 138 | { |
157 | .ctl_name = NET_SCTP_MAX_INIT_RETRANSMITS, | ||
158 | .procname = "max_init_retransmits", | 139 | .procname = "max_init_retransmits", |
159 | .data = &sctp_max_retrans_init, | 140 | .data = &sctp_max_retrans_init, |
160 | .maxlen = sizeof(int), | 141 | .maxlen = sizeof(int), |
161 | .mode = 0644, | 142 | .mode = 0644, |
162 | .proc_handler = proc_dointvec_minmax, | 143 | .proc_handler = proc_dointvec_minmax, |
163 | .strategy = sysctl_intvec, | ||
164 | .extra1 = &one, | 144 | .extra1 = &one, |
165 | .extra2 = &int_max | 145 | .extra2 = &int_max |
166 | }, | 146 | }, |
167 | { | 147 | { |
168 | .ctl_name = NET_SCTP_HB_INTERVAL, | ||
169 | .procname = "hb_interval", | 148 | .procname = "hb_interval", |
170 | .data = &sctp_hb_interval, | 149 | .data = &sctp_hb_interval, |
171 | .maxlen = sizeof(unsigned int), | 150 | .maxlen = sizeof(unsigned int), |
172 | .mode = 0644, | 151 | .mode = 0644, |
173 | .proc_handler = proc_dointvec_minmax, | 152 | .proc_handler = proc_dointvec_minmax, |
174 | .strategy = sysctl_intvec, | ||
175 | .extra1 = &one, | 153 | .extra1 = &one, |
176 | .extra2 = &timer_max | 154 | .extra2 = &timer_max |
177 | }, | 155 | }, |
178 | { | 156 | { |
179 | .ctl_name = NET_SCTP_PRESERVE_ENABLE, | ||
180 | .procname = "cookie_preserve_enable", | 157 | .procname = "cookie_preserve_enable", |
181 | .data = &sctp_cookie_preserve_enable, | 158 | .data = &sctp_cookie_preserve_enable, |
182 | .maxlen = sizeof(int), | 159 | .maxlen = sizeof(int), |
183 | .mode = 0644, | 160 | .mode = 0644, |
184 | .proc_handler = proc_dointvec, | 161 | .proc_handler = proc_dointvec, |
185 | .strategy = sysctl_intvec | ||
186 | }, | 162 | }, |
187 | { | 163 | { |
188 | .ctl_name = NET_SCTP_RTO_ALPHA, | ||
189 | .procname = "rto_alpha_exp_divisor", | 164 | .procname = "rto_alpha_exp_divisor", |
190 | .data = &sctp_rto_alpha, | 165 | .data = &sctp_rto_alpha, |
191 | .maxlen = sizeof(int), | 166 | .maxlen = sizeof(int), |
192 | .mode = 0444, | 167 | .mode = 0444, |
193 | .proc_handler = proc_dointvec, | 168 | .proc_handler = proc_dointvec, |
194 | .strategy = sysctl_intvec | ||
195 | }, | 169 | }, |
196 | { | 170 | { |
197 | .ctl_name = NET_SCTP_RTO_BETA, | ||
198 | .procname = "rto_beta_exp_divisor", | 171 | .procname = "rto_beta_exp_divisor", |
199 | .data = &sctp_rto_beta, | 172 | .data = &sctp_rto_beta, |
200 | .maxlen = sizeof(int), | 173 | .maxlen = sizeof(int), |
201 | .mode = 0444, | 174 | .mode = 0444, |
202 | .proc_handler = proc_dointvec, | 175 | .proc_handler = proc_dointvec, |
203 | .strategy = sysctl_intvec | ||
204 | }, | 176 | }, |
205 | { | 177 | { |
206 | .ctl_name = NET_SCTP_ADDIP_ENABLE, | ||
207 | .procname = "addip_enable", | 178 | .procname = "addip_enable", |
208 | .data = &sctp_addip_enable, | 179 | .data = &sctp_addip_enable, |
209 | .maxlen = sizeof(int), | 180 | .maxlen = sizeof(int), |
210 | .mode = 0644, | 181 | .mode = 0644, |
211 | .proc_handler = proc_dointvec, | 182 | .proc_handler = proc_dointvec, |
212 | .strategy = sysctl_intvec | ||
213 | }, | 183 | }, |
214 | { | 184 | { |
215 | .ctl_name = NET_SCTP_PRSCTP_ENABLE, | ||
216 | .procname = "prsctp_enable", | 185 | .procname = "prsctp_enable", |
217 | .data = &sctp_prsctp_enable, | 186 | .data = &sctp_prsctp_enable, |
218 | .maxlen = sizeof(int), | 187 | .maxlen = sizeof(int), |
219 | .mode = 0644, | 188 | .mode = 0644, |
220 | .proc_handler = proc_dointvec, | 189 | .proc_handler = proc_dointvec, |
221 | .strategy = sysctl_intvec | ||
222 | }, | 190 | }, |
223 | { | 191 | { |
224 | .ctl_name = NET_SCTP_SACK_TIMEOUT, | ||
225 | .procname = "sack_timeout", | 192 | .procname = "sack_timeout", |
226 | .data = &sctp_sack_timeout, | 193 | .data = &sctp_sack_timeout, |
227 | .maxlen = sizeof(int), | 194 | .maxlen = sizeof(int), |
228 | .mode = 0644, | 195 | .mode = 0644, |
229 | .proc_handler = proc_dointvec_minmax, | 196 | .proc_handler = proc_dointvec_minmax, |
230 | .strategy = sysctl_intvec, | ||
231 | .extra1 = &sack_timer_min, | 197 | .extra1 = &sack_timer_min, |
232 | .extra2 = &sack_timer_max, | 198 | .extra2 = &sack_timer_max, |
233 | }, | 199 | }, |
234 | { | 200 | { |
235 | .ctl_name = CTL_UNNUMBERED, | ||
236 | .procname = "sctp_mem", | 201 | .procname = "sctp_mem", |
237 | .data = &sysctl_sctp_mem, | 202 | .data = &sysctl_sctp_mem, |
238 | .maxlen = sizeof(sysctl_sctp_mem), | 203 | .maxlen = sizeof(sysctl_sctp_mem), |
@@ -240,7 +205,6 @@ static ctl_table sctp_table[] = { | |||
240 | .proc_handler = proc_dointvec, | 205 | .proc_handler = proc_dointvec, |
241 | }, | 206 | }, |
242 | { | 207 | { |
243 | .ctl_name = CTL_UNNUMBERED, | ||
244 | .procname = "sctp_rmem", | 208 | .procname = "sctp_rmem", |
245 | .data = &sysctl_sctp_rmem, | 209 | .data = &sysctl_sctp_rmem, |
246 | .maxlen = sizeof(sysctl_sctp_rmem), | 210 | .maxlen = sizeof(sysctl_sctp_rmem), |
@@ -248,7 +212,6 @@ static ctl_table sctp_table[] = { | |||
248 | .proc_handler = proc_dointvec, | 212 | .proc_handler = proc_dointvec, |
249 | }, | 213 | }, |
250 | { | 214 | { |
251 | .ctl_name = CTL_UNNUMBERED, | ||
252 | .procname = "sctp_wmem", | 215 | .procname = "sctp_wmem", |
253 | .data = &sysctl_sctp_wmem, | 216 | .data = &sysctl_sctp_wmem, |
254 | .maxlen = sizeof(sysctl_sctp_wmem), | 217 | .maxlen = sizeof(sysctl_sctp_wmem), |
@@ -256,40 +219,34 @@ static ctl_table sctp_table[] = { | |||
256 | .proc_handler = proc_dointvec, | 219 | .proc_handler = proc_dointvec, |
257 | }, | 220 | }, |
258 | { | 221 | { |
259 | .ctl_name = CTL_UNNUMBERED, | ||
260 | .procname = "auth_enable", | 222 | .procname = "auth_enable", |
261 | .data = &sctp_auth_enable, | 223 | .data = &sctp_auth_enable, |
262 | .maxlen = sizeof(int), | 224 | .maxlen = sizeof(int), |
263 | .mode = 0644, | 225 | .mode = 0644, |
264 | .proc_handler = proc_dointvec, | 226 | .proc_handler = proc_dointvec, |
265 | .strategy = sysctl_intvec | ||
266 | }, | 227 | }, |
267 | { | 228 | { |
268 | .ctl_name = CTL_UNNUMBERED, | ||
269 | .procname = "addip_noauth_enable", | 229 | .procname = "addip_noauth_enable", |
270 | .data = &sctp_addip_noauth, | 230 | .data = &sctp_addip_noauth, |
271 | .maxlen = sizeof(int), | 231 | .maxlen = sizeof(int), |
272 | .mode = 0644, | 232 | .mode = 0644, |
273 | .proc_handler = proc_dointvec, | 233 | .proc_handler = proc_dointvec, |
274 | .strategy = sysctl_intvec | ||
275 | }, | 234 | }, |
276 | { | 235 | { |
277 | .ctl_name = CTL_UNNUMBERED, | ||
278 | .procname = "addr_scope_policy", | 236 | .procname = "addr_scope_policy", |
279 | .data = &sctp_scope_policy, | 237 | .data = &sctp_scope_policy, |
280 | .maxlen = sizeof(int), | 238 | .maxlen = sizeof(int), |
281 | .mode = 0644, | 239 | .mode = 0644, |
282 | .proc_handler = &proc_dointvec_minmax, | 240 | .proc_handler = proc_dointvec_minmax, |
283 | .strategy = &sysctl_intvec, | ||
284 | .extra1 = &zero, | 241 | .extra1 = &zero, |
285 | .extra2 = &addr_scope_max, | 242 | .extra2 = &addr_scope_max, |
286 | }, | 243 | }, |
287 | { .ctl_name = 0 } | 244 | { } |
288 | }; | 245 | }; |
289 | 246 | ||
290 | static struct ctl_path sctp_path[] = { | 247 | static struct ctl_path sctp_path[] = { |
291 | { .procname = "net", .ctl_name = CTL_NET, }, | 248 | { .procname = "net", }, |
292 | { .procname = "sctp", .ctl_name = NET_SCTP, }, | 249 | { .procname = "sctp", }, |
293 | { } | 250 | { } |
294 | }; | 251 | }; |
295 | 252 | ||
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 42f9748ae093..e65dcc613339 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c | |||
@@ -139,46 +139,45 @@ static ctl_table debug_table[] = { | |||
139 | .data = &rpc_debug, | 139 | .data = &rpc_debug, |
140 | .maxlen = sizeof(int), | 140 | .maxlen = sizeof(int), |
141 | .mode = 0644, | 141 | .mode = 0644, |
142 | .proc_handler = &proc_dodebug | 142 | .proc_handler = proc_dodebug |
143 | }, | 143 | }, |
144 | { | 144 | { |
145 | .procname = "nfs_debug", | 145 | .procname = "nfs_debug", |
146 | .data = &nfs_debug, | 146 | .data = &nfs_debug, |
147 | .maxlen = sizeof(int), | 147 | .maxlen = sizeof(int), |
148 | .mode = 0644, | 148 | .mode = 0644, |
149 | .proc_handler = &proc_dodebug | 149 | .proc_handler = proc_dodebug |
150 | }, | 150 | }, |
151 | { | 151 | { |
152 | .procname = "nfsd_debug", | 152 | .procname = "nfsd_debug", |
153 | .data = &nfsd_debug, | 153 | .data = &nfsd_debug, |
154 | .maxlen = sizeof(int), | 154 | .maxlen = sizeof(int), |
155 | .mode = 0644, | 155 | .mode = 0644, |
156 | .proc_handler = &proc_dodebug | 156 | .proc_handler = proc_dodebug |
157 | }, | 157 | }, |
158 | { | 158 | { |
159 | .procname = "nlm_debug", | 159 | .procname = "nlm_debug", |
160 | .data = &nlm_debug, | 160 | .data = &nlm_debug, |
161 | .maxlen = sizeof(int), | 161 | .maxlen = sizeof(int), |
162 | .mode = 0644, | 162 | .mode = 0644, |
163 | .proc_handler = &proc_dodebug | 163 | .proc_handler = proc_dodebug |
164 | }, | 164 | }, |
165 | { | 165 | { |
166 | .procname = "transports", | 166 | .procname = "transports", |
167 | .maxlen = 256, | 167 | .maxlen = 256, |
168 | .mode = 0444, | 168 | .mode = 0444, |
169 | .proc_handler = &proc_do_xprt, | 169 | .proc_handler = proc_do_xprt, |
170 | }, | 170 | }, |
171 | { .ctl_name = 0 } | 171 | { } |
172 | }; | 172 | }; |
173 | 173 | ||
174 | static ctl_table sunrpc_table[] = { | 174 | static ctl_table sunrpc_table[] = { |
175 | { | 175 | { |
176 | .ctl_name = CTL_SUNRPC, | ||
177 | .procname = "sunrpc", | 176 | .procname = "sunrpc", |
178 | .mode = 0555, | 177 | .mode = 0555, |
179 | .child = debug_table | 178 | .child = debug_table |
180 | }, | 179 | }, |
181 | { .ctl_name = 0 } | 180 | { } |
182 | }; | 181 | }; |
183 | 182 | ||
184 | #endif | 183 | #endif |
diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index 35fb68b9c8ec..5b8a8ff93a25 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c +++ b/net/sunrpc/xprtrdma/svc_rdma.c | |||
@@ -120,8 +120,7 @@ static ctl_table svcrdma_parm_table[] = { | |||
120 | .data = &svcrdma_max_requests, | 120 | .data = &svcrdma_max_requests, |
121 | .maxlen = sizeof(unsigned int), | 121 | .maxlen = sizeof(unsigned int), |
122 | .mode = 0644, | 122 | .mode = 0644, |
123 | .proc_handler = &proc_dointvec_minmax, | 123 | .proc_handler = proc_dointvec_minmax, |
124 | .strategy = &sysctl_intvec, | ||
125 | .extra1 = &min_max_requests, | 124 | .extra1 = &min_max_requests, |
126 | .extra2 = &max_max_requests | 125 | .extra2 = &max_max_requests |
127 | }, | 126 | }, |
@@ -130,8 +129,7 @@ static ctl_table svcrdma_parm_table[] = { | |||
130 | .data = &svcrdma_max_req_size, | 129 | .data = &svcrdma_max_req_size, |
131 | .maxlen = sizeof(unsigned int), | 130 | .maxlen = sizeof(unsigned int), |
132 | .mode = 0644, | 131 | .mode = 0644, |
133 | .proc_handler = &proc_dointvec_minmax, | 132 | .proc_handler = proc_dointvec_minmax, |
134 | .strategy = &sysctl_intvec, | ||
135 | .extra1 = &min_max_inline, | 133 | .extra1 = &min_max_inline, |
136 | .extra2 = &max_max_inline | 134 | .extra2 = &max_max_inline |
137 | }, | 135 | }, |
@@ -140,8 +138,7 @@ static ctl_table svcrdma_parm_table[] = { | |||
140 | .data = &svcrdma_ord, | 138 | .data = &svcrdma_ord, |
141 | .maxlen = sizeof(unsigned int), | 139 | .maxlen = sizeof(unsigned int), |
142 | .mode = 0644, | 140 | .mode = 0644, |
143 | .proc_handler = &proc_dointvec_minmax, | 141 | .proc_handler = proc_dointvec_minmax, |
144 | .strategy = &sysctl_intvec, | ||
145 | .extra1 = &min_ord, | 142 | .extra1 = &min_ord, |
146 | .extra2 = &max_ord, | 143 | .extra2 = &max_ord, |
147 | }, | 144 | }, |
@@ -151,67 +148,65 @@ static ctl_table svcrdma_parm_table[] = { | |||
151 | .data = &rdma_stat_read, | 148 | .data = &rdma_stat_read, |
152 | .maxlen = sizeof(atomic_t), | 149 | .maxlen = sizeof(atomic_t), |
153 | .mode = 0644, | 150 | .mode = 0644, |
154 | .proc_handler = &read_reset_stat, | 151 | .proc_handler = read_reset_stat, |
155 | }, | 152 | }, |
156 | { | 153 | { |
157 | .procname = "rdma_stat_recv", | 154 | .procname = "rdma_stat_recv", |
158 | .data = &rdma_stat_recv, | 155 | .data = &rdma_stat_recv, |
159 | .maxlen = sizeof(atomic_t), | 156 | .maxlen = sizeof(atomic_t), |
160 | .mode = 0644, | 157 | .mode = 0644, |
161 | .proc_handler = &read_reset_stat, | 158 | .proc_handler = read_reset_stat, |
162 | }, | 159 | }, |
163 | { | 160 | { |
164 | .procname = "rdma_stat_write", | 161 | .procname = "rdma_stat_write", |
165 | .data = &rdma_stat_write, | 162 | .data = &rdma_stat_write, |
166 | .maxlen = sizeof(atomic_t), | 163 | .maxlen = sizeof(atomic_t), |
167 | .mode = 0644, | 164 | .mode = 0644, |
168 | .proc_handler = &read_reset_stat, | 165 | .proc_handler = read_reset_stat, |
169 | }, | 166 | }, |
170 | { | 167 | { |
171 | .procname = "rdma_stat_sq_starve", | 168 | .procname = "rdma_stat_sq_starve", |
172 | .data = &rdma_stat_sq_starve, | 169 | .data = &rdma_stat_sq_starve, |
173 | .maxlen = sizeof(atomic_t), | 170 | .maxlen = sizeof(atomic_t), |
174 | .mode = 0644, | 171 | .mode = 0644, |
175 | .proc_handler = &read_reset_stat, | 172 | .proc_handler = read_reset_stat, |
176 | }, | 173 | }, |
177 | { | 174 | { |
178 | .procname = "rdma_stat_rq_starve", | 175 | .procname = "rdma_stat_rq_starve", |
179 | .data = &rdma_stat_rq_starve, | 176 | .data = &rdma_stat_rq_starve, |
180 | .maxlen = sizeof(atomic_t), | 177 | .maxlen = sizeof(atomic_t), |
181 | .mode = 0644, | 178 | .mode = 0644, |
182 | .proc_handler = &read_reset_stat, | 179 | .proc_handler = read_reset_stat, |
183 | }, | 180 | }, |
184 | { | 181 | { |
185 | .procname = "rdma_stat_rq_poll", | 182 | .procname = "rdma_stat_rq_poll", |
186 | .data = &rdma_stat_rq_poll, | 183 | .data = &rdma_stat_rq_poll, |
187 | .maxlen = sizeof(atomic_t), | 184 | .maxlen = sizeof(atomic_t), |
188 | .mode = 0644, | 185 | .mode = 0644, |
189 | .proc_handler = &read_reset_stat, | 186 | .proc_handler = read_reset_stat, |
190 | }, | 187 | }, |
191 | { | 188 | { |
192 | .procname = "rdma_stat_rq_prod", | 189 | .procname = "rdma_stat_rq_prod", |
193 | .data = &rdma_stat_rq_prod, | 190 | .data = &rdma_stat_rq_prod, |
194 | .maxlen = sizeof(atomic_t), | 191 | .maxlen = sizeof(atomic_t), |
195 | .mode = 0644, | 192 | .mode = 0644, |
196 | .proc_handler = &read_reset_stat, | 193 | .proc_handler = read_reset_stat, |
197 | }, | 194 | }, |
198 | { | 195 | { |
199 | .procname = "rdma_stat_sq_poll", | 196 | .procname = "rdma_stat_sq_poll", |
200 | .data = &rdma_stat_sq_poll, | 197 | .data = &rdma_stat_sq_poll, |
201 | .maxlen = sizeof(atomic_t), | 198 | .maxlen = sizeof(atomic_t), |
202 | .mode = 0644, | 199 | .mode = 0644, |
203 | .proc_handler = &read_reset_stat, | 200 | .proc_handler = read_reset_stat, |
204 | }, | 201 | }, |
205 | { | 202 | { |
206 | .procname = "rdma_stat_sq_prod", | 203 | .procname = "rdma_stat_sq_prod", |
207 | .data = &rdma_stat_sq_prod, | 204 | .data = &rdma_stat_sq_prod, |
208 | .maxlen = sizeof(atomic_t), | 205 | .maxlen = sizeof(atomic_t), |
209 | .mode = 0644, | 206 | .mode = 0644, |
210 | .proc_handler = &read_reset_stat, | 207 | .proc_handler = read_reset_stat, |
211 | }, | ||
212 | { | ||
213 | .ctl_name = 0, | ||
214 | }, | 208 | }, |
209 | { }, | ||
215 | }; | 210 | }; |
216 | 211 | ||
217 | static ctl_table svcrdma_table[] = { | 212 | static ctl_table svcrdma_table[] = { |
@@ -220,21 +215,16 @@ static ctl_table svcrdma_table[] = { | |||
220 | .mode = 0555, | 215 | .mode = 0555, |
221 | .child = svcrdma_parm_table | 216 | .child = svcrdma_parm_table |
222 | }, | 217 | }, |
223 | { | 218 | { }, |
224 | .ctl_name = 0, | ||
225 | }, | ||
226 | }; | 219 | }; |
227 | 220 | ||
228 | static ctl_table svcrdma_root_table[] = { | 221 | static ctl_table svcrdma_root_table[] = { |
229 | { | 222 | { |
230 | .ctl_name = CTL_SUNRPC, | ||
231 | .procname = "sunrpc", | 223 | .procname = "sunrpc", |
232 | .mode = 0555, | 224 | .mode = 0555, |
233 | .child = svcrdma_table | 225 | .child = svcrdma_table |
234 | }, | 226 | }, |
235 | { | 227 | { }, |
236 | .ctl_name = 0, | ||
237 | }, | ||
238 | }; | 228 | }; |
239 | 229 | ||
240 | void svc_rdma_cleanup(void) | 230 | void svc_rdma_cleanup(void) |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 9a63f669ece4..7018eef1dcdd 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -86,79 +86,63 @@ static struct ctl_table_header *sunrpc_table_header; | |||
86 | 86 | ||
87 | static ctl_table xr_tunables_table[] = { | 87 | static ctl_table xr_tunables_table[] = { |
88 | { | 88 | { |
89 | .ctl_name = CTL_UNNUMBERED, | ||
90 | .procname = "rdma_slot_table_entries", | 89 | .procname = "rdma_slot_table_entries", |
91 | .data = &xprt_rdma_slot_table_entries, | 90 | .data = &xprt_rdma_slot_table_entries, |
92 | .maxlen = sizeof(unsigned int), | 91 | .maxlen = sizeof(unsigned int), |
93 | .mode = 0644, | 92 | .mode = 0644, |
94 | .proc_handler = &proc_dointvec_minmax, | 93 | .proc_handler = proc_dointvec_minmax, |
95 | .strategy = &sysctl_intvec, | ||
96 | .extra1 = &min_slot_table_size, | 94 | .extra1 = &min_slot_table_size, |
97 | .extra2 = &max_slot_table_size | 95 | .extra2 = &max_slot_table_size |
98 | }, | 96 | }, |
99 | { | 97 | { |
100 | .ctl_name = CTL_UNNUMBERED, | ||
101 | .procname = "rdma_max_inline_read", | 98 | .procname = "rdma_max_inline_read", |
102 | .data = &xprt_rdma_max_inline_read, | 99 | .data = &xprt_rdma_max_inline_read, |
103 | .maxlen = sizeof(unsigned int), | 100 | .maxlen = sizeof(unsigned int), |
104 | .mode = 0644, | 101 | .mode = 0644, |
105 | .proc_handler = &proc_dointvec, | 102 | .proc_handler = proc_dointvec, |
106 | .strategy = &sysctl_intvec, | ||
107 | }, | 103 | }, |
108 | { | 104 | { |
109 | .ctl_name = CTL_UNNUMBERED, | ||
110 | .procname = "rdma_max_inline_write", | 105 | .procname = "rdma_max_inline_write", |
111 | .data = &xprt_rdma_max_inline_write, | 106 | .data = &xprt_rdma_max_inline_write, |
112 | .maxlen = sizeof(unsigned int), | 107 | .maxlen = sizeof(unsigned int), |
113 | .mode = 0644, | 108 | .mode = 0644, |
114 | .proc_handler = &proc_dointvec, | 109 | .proc_handler = proc_dointvec, |
115 | .strategy = &sysctl_intvec, | ||
116 | }, | 110 | }, |
117 | { | 111 | { |
118 | .ctl_name = CTL_UNNUMBERED, | ||
119 | .procname = "rdma_inline_write_padding", | 112 | .procname = "rdma_inline_write_padding", |
120 | .data = &xprt_rdma_inline_write_padding, | 113 | .data = &xprt_rdma_inline_write_padding, |
121 | .maxlen = sizeof(unsigned int), | 114 | .maxlen = sizeof(unsigned int), |
122 | .mode = 0644, | 115 | .mode = 0644, |
123 | .proc_handler = &proc_dointvec_minmax, | 116 | .proc_handler = proc_dointvec_minmax, |
124 | .strategy = &sysctl_intvec, | ||
125 | .extra1 = &zero, | 117 | .extra1 = &zero, |
126 | .extra2 = &max_padding, | 118 | .extra2 = &max_padding, |
127 | }, | 119 | }, |
128 | { | 120 | { |
129 | .ctl_name = CTL_UNNUMBERED, | ||
130 | .procname = "rdma_memreg_strategy", | 121 | .procname = "rdma_memreg_strategy", |
131 | .data = &xprt_rdma_memreg_strategy, | 122 | .data = &xprt_rdma_memreg_strategy, |
132 | .maxlen = sizeof(unsigned int), | 123 | .maxlen = sizeof(unsigned int), |
133 | .mode = 0644, | 124 | .mode = 0644, |
134 | .proc_handler = &proc_dointvec_minmax, | 125 | .proc_handler = proc_dointvec_minmax, |
135 | .strategy = &sysctl_intvec, | ||
136 | .extra1 = &min_memreg, | 126 | .extra1 = &min_memreg, |
137 | .extra2 = &max_memreg, | 127 | .extra2 = &max_memreg, |
138 | }, | 128 | }, |
139 | { | 129 | { |
140 | .ctl_name = CTL_UNNUMBERED, | ||
141 | .procname = "rdma_pad_optimize", | 130 | .procname = "rdma_pad_optimize", |
142 | .data = &xprt_rdma_pad_optimize, | 131 | .data = &xprt_rdma_pad_optimize, |
143 | .maxlen = sizeof(unsigned int), | 132 | .maxlen = sizeof(unsigned int), |
144 | .mode = 0644, | 133 | .mode = 0644, |
145 | .proc_handler = &proc_dointvec, | 134 | .proc_handler = proc_dointvec, |
146 | }, | ||
147 | { | ||
148 | .ctl_name = 0, | ||
149 | }, | 135 | }, |
136 | { }, | ||
150 | }; | 137 | }; |
151 | 138 | ||
152 | static ctl_table sunrpc_table[] = { | 139 | static ctl_table sunrpc_table[] = { |
153 | { | 140 | { |
154 | .ctl_name = CTL_SUNRPC, | ||
155 | .procname = "sunrpc", | 141 | .procname = "sunrpc", |
156 | .mode = 0555, | 142 | .mode = 0555, |
157 | .child = xr_tunables_table | 143 | .child = xr_tunables_table |
158 | }, | 144 | }, |
159 | { | 145 | { }, |
160 | .ctl_name = 0, | ||
161 | }, | ||
162 | }; | 146 | }; |
163 | 147 | ||
164 | #endif | 148 | #endif |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 37c5475ba258..04732d09013e 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -81,46 +81,38 @@ static struct ctl_table_header *sunrpc_table_header; | |||
81 | */ | 81 | */ |
82 | static ctl_table xs_tunables_table[] = { | 82 | static ctl_table xs_tunables_table[] = { |
83 | { | 83 | { |
84 | .ctl_name = CTL_SLOTTABLE_UDP, | ||
85 | .procname = "udp_slot_table_entries", | 84 | .procname = "udp_slot_table_entries", |
86 | .data = &xprt_udp_slot_table_entries, | 85 | .data = &xprt_udp_slot_table_entries, |
87 | .maxlen = sizeof(unsigned int), | 86 | .maxlen = sizeof(unsigned int), |
88 | .mode = 0644, | 87 | .mode = 0644, |
89 | .proc_handler = &proc_dointvec_minmax, | 88 | .proc_handler = proc_dointvec_minmax, |
90 | .strategy = &sysctl_intvec, | ||
91 | .extra1 = &min_slot_table_size, | 89 | .extra1 = &min_slot_table_size, |
92 | .extra2 = &max_slot_table_size | 90 | .extra2 = &max_slot_table_size |
93 | }, | 91 | }, |
94 | { | 92 | { |
95 | .ctl_name = CTL_SLOTTABLE_TCP, | ||
96 | .procname = "tcp_slot_table_entries", | 93 | .procname = "tcp_slot_table_entries", |
97 | .data = &xprt_tcp_slot_table_entries, | 94 | .data = &xprt_tcp_slot_table_entries, |
98 | .maxlen = sizeof(unsigned int), | 95 | .maxlen = sizeof(unsigned int), |
99 | .mode = 0644, | 96 | .mode = 0644, |
100 | .proc_handler = &proc_dointvec_minmax, | 97 | .proc_handler = proc_dointvec_minmax, |
101 | .strategy = &sysctl_intvec, | ||
102 | .extra1 = &min_slot_table_size, | 98 | .extra1 = &min_slot_table_size, |
103 | .extra2 = &max_slot_table_size | 99 | .extra2 = &max_slot_table_size |
104 | }, | 100 | }, |
105 | { | 101 | { |
106 | .ctl_name = CTL_MIN_RESVPORT, | ||
107 | .procname = "min_resvport", | 102 | .procname = "min_resvport", |
108 | .data = &xprt_min_resvport, | 103 | .data = &xprt_min_resvport, |
109 | .maxlen = sizeof(unsigned int), | 104 | .maxlen = sizeof(unsigned int), |
110 | .mode = 0644, | 105 | .mode = 0644, |
111 | .proc_handler = &proc_dointvec_minmax, | 106 | .proc_handler = proc_dointvec_minmax, |
112 | .strategy = &sysctl_intvec, | ||
113 | .extra1 = &xprt_min_resvport_limit, | 107 | .extra1 = &xprt_min_resvport_limit, |
114 | .extra2 = &xprt_max_resvport_limit | 108 | .extra2 = &xprt_max_resvport_limit |
115 | }, | 109 | }, |
116 | { | 110 | { |
117 | .ctl_name = CTL_MAX_RESVPORT, | ||
118 | .procname = "max_resvport", | 111 | .procname = "max_resvport", |
119 | .data = &xprt_max_resvport, | 112 | .data = &xprt_max_resvport, |
120 | .maxlen = sizeof(unsigned int), | 113 | .maxlen = sizeof(unsigned int), |
121 | .mode = 0644, | 114 | .mode = 0644, |
122 | .proc_handler = &proc_dointvec_minmax, | 115 | .proc_handler = proc_dointvec_minmax, |
123 | .strategy = &sysctl_intvec, | ||
124 | .extra1 = &xprt_min_resvport_limit, | 116 | .extra1 = &xprt_min_resvport_limit, |
125 | .extra2 = &xprt_max_resvport_limit | 117 | .extra2 = &xprt_max_resvport_limit |
126 | }, | 118 | }, |
@@ -129,24 +121,18 @@ static ctl_table xs_tunables_table[] = { | |||
129 | .data = &xs_tcp_fin_timeout, | 121 | .data = &xs_tcp_fin_timeout, |
130 | .maxlen = sizeof(xs_tcp_fin_timeout), | 122 | .maxlen = sizeof(xs_tcp_fin_timeout), |
131 | .mode = 0644, | 123 | .mode = 0644, |
132 | .proc_handler = &proc_dointvec_jiffies, | 124 | .proc_handler = proc_dointvec_jiffies, |
133 | .strategy = sysctl_jiffies | ||
134 | }, | ||
135 | { | ||
136 | .ctl_name = 0, | ||
137 | }, | 125 | }, |
126 | { }, | ||
138 | }; | 127 | }; |
139 | 128 | ||
140 | static ctl_table sunrpc_table[] = { | 129 | static ctl_table sunrpc_table[] = { |
141 | { | 130 | { |
142 | .ctl_name = CTL_SUNRPC, | ||
143 | .procname = "sunrpc", | 131 | .procname = "sunrpc", |
144 | .mode = 0555, | 132 | .mode = 0555, |
145 | .child = xs_tunables_table | 133 | .child = xs_tunables_table |
146 | }, | 134 | }, |
147 | { | 135 | { }, |
148 | .ctl_name = 0, | ||
149 | }, | ||
150 | }; | 136 | }; |
151 | 137 | ||
152 | #endif | 138 | #endif |
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c index 83c093077ebc..708f5df6b7f0 100644 --- a/net/unix/sysctl_net_unix.c +++ b/net/unix/sysctl_net_unix.c | |||
@@ -16,19 +16,18 @@ | |||
16 | 16 | ||
17 | static ctl_table unix_table[] = { | 17 | static ctl_table unix_table[] = { |
18 | { | 18 | { |
19 | .ctl_name = NET_UNIX_MAX_DGRAM_QLEN, | ||
20 | .procname = "max_dgram_qlen", | 19 | .procname = "max_dgram_qlen", |
21 | .data = &init_net.unx.sysctl_max_dgram_qlen, | 20 | .data = &init_net.unx.sysctl_max_dgram_qlen, |
22 | .maxlen = sizeof(int), | 21 | .maxlen = sizeof(int), |
23 | .mode = 0644, | 22 | .mode = 0644, |
24 | .proc_handler = proc_dointvec | 23 | .proc_handler = proc_dointvec |
25 | }, | 24 | }, |
26 | { .ctl_name = 0 } | 25 | { } |
27 | }; | 26 | }; |
28 | 27 | ||
29 | static struct ctl_path unix_path[] = { | 28 | static struct ctl_path unix_path[] = { |
30 | { .procname = "net", .ctl_name = CTL_NET, }, | 29 | { .procname = "net", }, |
31 | { .procname = "unix", .ctl_name = NET_UNIX, }, | 30 | { .procname = "unix", }, |
32 | { }, | 31 | { }, |
33 | }; | 32 | }; |
34 | 33 | ||
diff --git a/net/x25/sysctl_net_x25.c b/net/x25/sysctl_net_x25.c index a5d3416522de..d2efd29f434e 100644 --- a/net/x25/sysctl_net_x25.c +++ b/net/x25/sysctl_net_x25.c | |||
@@ -19,62 +19,51 @@ static struct ctl_table_header *x25_table_header; | |||
19 | 19 | ||
20 | static struct ctl_table x25_table[] = { | 20 | static struct ctl_table x25_table[] = { |
21 | { | 21 | { |
22 | .ctl_name = NET_X25_RESTART_REQUEST_TIMEOUT, | ||
23 | .procname = "restart_request_timeout", | 22 | .procname = "restart_request_timeout", |
24 | .data = &sysctl_x25_restart_request_timeout, | 23 | .data = &sysctl_x25_restart_request_timeout, |
25 | .maxlen = sizeof(int), | 24 | .maxlen = sizeof(int), |
26 | .mode = 0644, | 25 | .mode = 0644, |
27 | .proc_handler = proc_dointvec_minmax, | 26 | .proc_handler = proc_dointvec_minmax, |
28 | .strategy = sysctl_intvec, | ||
29 | .extra1 = &min_timer, | 27 | .extra1 = &min_timer, |
30 | .extra2 = &max_timer, | 28 | .extra2 = &max_timer, |
31 | }, | 29 | }, |
32 | { | 30 | { |
33 | .ctl_name = NET_X25_CALL_REQUEST_TIMEOUT, | ||
34 | .procname = "call_request_timeout", | 31 | .procname = "call_request_timeout", |
35 | .data = &sysctl_x25_call_request_timeout, | 32 | .data = &sysctl_x25_call_request_timeout, |
36 | .maxlen = sizeof(int), | 33 | .maxlen = sizeof(int), |
37 | .mode = 0644, | 34 | .mode = 0644, |
38 | .proc_handler = proc_dointvec_minmax, | 35 | .proc_handler = proc_dointvec_minmax, |
39 | .strategy = sysctl_intvec, | ||
40 | .extra1 = &min_timer, | 36 | .extra1 = &min_timer, |
41 | .extra2 = &max_timer, | 37 | .extra2 = &max_timer, |
42 | }, | 38 | }, |
43 | { | 39 | { |
44 | .ctl_name = NET_X25_RESET_REQUEST_TIMEOUT, | ||
45 | .procname = "reset_request_timeout", | 40 | .procname = "reset_request_timeout", |
46 | .data = &sysctl_x25_reset_request_timeout, | 41 | .data = &sysctl_x25_reset_request_timeout, |
47 | .maxlen = sizeof(int), | 42 | .maxlen = sizeof(int), |
48 | .mode = 0644, | 43 | .mode = 0644, |
49 | .proc_handler = proc_dointvec_minmax, | 44 | .proc_handler = proc_dointvec_minmax, |
50 | .strategy = sysctl_intvec, | ||
51 | .extra1 = &min_timer, | 45 | .extra1 = &min_timer, |
52 | .extra2 = &max_timer, | 46 | .extra2 = &max_timer, |
53 | }, | 47 | }, |
54 | { | 48 | { |
55 | .ctl_name = NET_X25_CLEAR_REQUEST_TIMEOUT, | ||
56 | .procname = "clear_request_timeout", | 49 | .procname = "clear_request_timeout", |
57 | .data = &sysctl_x25_clear_request_timeout, | 50 | .data = &sysctl_x25_clear_request_timeout, |
58 | .maxlen = sizeof(int), | 51 | .maxlen = sizeof(int), |
59 | .mode = 0644, | 52 | .mode = 0644, |
60 | .proc_handler = proc_dointvec_minmax, | 53 | .proc_handler = proc_dointvec_minmax, |
61 | .strategy = sysctl_intvec, | ||
62 | .extra1 = &min_timer, | 54 | .extra1 = &min_timer, |
63 | .extra2 = &max_timer, | 55 | .extra2 = &max_timer, |
64 | }, | 56 | }, |
65 | { | 57 | { |
66 | .ctl_name = NET_X25_ACK_HOLD_BACK_TIMEOUT, | ||
67 | .procname = "acknowledgement_hold_back_timeout", | 58 | .procname = "acknowledgement_hold_back_timeout", |
68 | .data = &sysctl_x25_ack_holdback_timeout, | 59 | .data = &sysctl_x25_ack_holdback_timeout, |
69 | .maxlen = sizeof(int), | 60 | .maxlen = sizeof(int), |
70 | .mode = 0644, | 61 | .mode = 0644, |
71 | .proc_handler = proc_dointvec_minmax, | 62 | .proc_handler = proc_dointvec_minmax, |
72 | .strategy = sysctl_intvec, | ||
73 | .extra1 = &min_timer, | 63 | .extra1 = &min_timer, |
74 | .extra2 = &max_timer, | 64 | .extra2 = &max_timer, |
75 | }, | 65 | }, |
76 | { | 66 | { |
77 | .ctl_name = NET_X25_FORWARD, | ||
78 | .procname = "x25_forward", | 67 | .procname = "x25_forward", |
79 | .data = &sysctl_x25_forward, | 68 | .data = &sysctl_x25_forward, |
80 | .maxlen = sizeof(int), | 69 | .maxlen = sizeof(int), |
@@ -85,8 +74,8 @@ static struct ctl_table x25_table[] = { | |||
85 | }; | 74 | }; |
86 | 75 | ||
87 | static struct ctl_path x25_path[] = { | 76 | static struct ctl_path x25_path[] = { |
88 | { .procname = "net", .ctl_name = CTL_NET, }, | 77 | { .procname = "net", }, |
89 | { .procname = "x25", .ctl_name = NET_X25, }, | 78 | { .procname = "x25", }, |
90 | { } | 79 | { } |
91 | }; | 80 | }; |
92 | 81 | ||
diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c index 2e6ffb66f06f..2e221f2cad7e 100644 --- a/net/xfrm/xfrm_sysctl.c +++ b/net/xfrm/xfrm_sysctl.c | |||
@@ -13,28 +13,24 @@ static void __xfrm_sysctl_init(struct net *net) | |||
13 | #ifdef CONFIG_SYSCTL | 13 | #ifdef CONFIG_SYSCTL |
14 | static struct ctl_table xfrm_table[] = { | 14 | static struct ctl_table xfrm_table[] = { |
15 | { | 15 | { |
16 | .ctl_name = NET_CORE_AEVENT_ETIME, | ||
17 | .procname = "xfrm_aevent_etime", | 16 | .procname = "xfrm_aevent_etime", |
18 | .maxlen = sizeof(u32), | 17 | .maxlen = sizeof(u32), |
19 | .mode = 0644, | 18 | .mode = 0644, |
20 | .proc_handler = proc_dointvec | 19 | .proc_handler = proc_dointvec |
21 | }, | 20 | }, |
22 | { | 21 | { |
23 | .ctl_name = NET_CORE_AEVENT_RSEQTH, | ||
24 | .procname = "xfrm_aevent_rseqth", | 22 | .procname = "xfrm_aevent_rseqth", |
25 | .maxlen = sizeof(u32), | 23 | .maxlen = sizeof(u32), |
26 | .mode = 0644, | 24 | .mode = 0644, |
27 | .proc_handler = proc_dointvec | 25 | .proc_handler = proc_dointvec |
28 | }, | 26 | }, |
29 | { | 27 | { |
30 | .ctl_name = CTL_UNNUMBERED, | ||
31 | .procname = "xfrm_larval_drop", | 28 | .procname = "xfrm_larval_drop", |
32 | .maxlen = sizeof(int), | 29 | .maxlen = sizeof(int), |
33 | .mode = 0644, | 30 | .mode = 0644, |
34 | .proc_handler = proc_dointvec | 31 | .proc_handler = proc_dointvec |
35 | }, | 32 | }, |
36 | { | 33 | { |
37 | .ctl_name = CTL_UNNUMBERED, | ||
38 | .procname = "xfrm_acq_expires", | 34 | .procname = "xfrm_acq_expires", |
39 | .maxlen = sizeof(int), | 35 | .maxlen = sizeof(int), |
40 | .mode = 0644, | 36 | .mode = 0644, |
diff --git a/security/keys/sysctl.c b/security/keys/sysctl.c index 5e05dc09e2db..ee32d181764a 100644 --- a/security/keys/sysctl.c +++ b/security/keys/sysctl.c | |||
@@ -17,54 +17,49 @@ static const int zero, one = 1, max = INT_MAX; | |||
17 | 17 | ||
18 | ctl_table key_sysctls[] = { | 18 | ctl_table key_sysctls[] = { |
19 | { | 19 | { |
20 | .ctl_name = CTL_UNNUMBERED, | ||
21 | .procname = "maxkeys", | 20 | .procname = "maxkeys", |
22 | .data = &key_quota_maxkeys, | 21 | .data = &key_quota_maxkeys, |
23 | .maxlen = sizeof(unsigned), | 22 | .maxlen = sizeof(unsigned), |
24 | .mode = 0644, | 23 | .mode = 0644, |
25 | .proc_handler = &proc_dointvec_minmax, | 24 | .proc_handler = proc_dointvec_minmax, |
26 | .extra1 = (void *) &one, | 25 | .extra1 = (void *) &one, |
27 | .extra2 = (void *) &max, | 26 | .extra2 = (void *) &max, |
28 | }, | 27 | }, |
29 | { | 28 | { |
30 | .ctl_name = CTL_UNNUMBERED, | ||
31 | .procname = "maxbytes", | 29 | .procname = "maxbytes", |
32 | .data = &key_quota_maxbytes, | 30 | .data = &key_quota_maxbytes, |
33 | .maxlen = sizeof(unsigned), | 31 | .maxlen = sizeof(unsigned), |
34 | .mode = 0644, | 32 | .mode = 0644, |
35 | .proc_handler = &proc_dointvec_minmax, | 33 | .proc_handler = proc_dointvec_minmax, |
36 | .extra1 = (void *) &one, | 34 | .extra1 = (void *) &one, |
37 | .extra2 = (void *) &max, | 35 | .extra2 = (void *) &max, |
38 | }, | 36 | }, |
39 | { | 37 | { |
40 | .ctl_name = CTL_UNNUMBERED, | ||
41 | .procname = "root_maxkeys", | 38 | .procname = "root_maxkeys", |
42 | .data = &key_quota_root_maxkeys, | 39 | .data = &key_quota_root_maxkeys, |
43 | .maxlen = sizeof(unsigned), | 40 | .maxlen = sizeof(unsigned), |
44 | .mode = 0644, | 41 | .mode = 0644, |
45 | .proc_handler = &proc_dointvec_minmax, | 42 | .proc_handler = proc_dointvec_minmax, |
46 | .extra1 = (void *) &one, | 43 | .extra1 = (void *) &one, |
47 | .extra2 = (void *) &max, | 44 | .extra2 = (void *) &max, |
48 | }, | 45 | }, |
49 | { | 46 | { |
50 | .ctl_name = CTL_UNNUMBERED, | ||
51 | .procname = "root_maxbytes", | 47 | .procname = "root_maxbytes", |
52 | .data = &key_quota_root_maxbytes, | 48 | .data = &key_quota_root_maxbytes, |
53 | .maxlen = sizeof(unsigned), | 49 | .maxlen = sizeof(unsigned), |
54 | .mode = 0644, | 50 | .mode = 0644, |
55 | .proc_handler = &proc_dointvec_minmax, | 51 | .proc_handler = proc_dointvec_minmax, |
56 | .extra1 = (void *) &one, | 52 | .extra1 = (void *) &one, |
57 | .extra2 = (void *) &max, | 53 | .extra2 = (void *) &max, |
58 | }, | 54 | }, |
59 | { | 55 | { |
60 | .ctl_name = CTL_UNNUMBERED, | ||
61 | .procname = "gc_delay", | 56 | .procname = "gc_delay", |
62 | .data = &key_gc_delay, | 57 | .data = &key_gc_delay, |
63 | .maxlen = sizeof(unsigned), | 58 | .maxlen = sizeof(unsigned), |
64 | .mode = 0644, | 59 | .mode = 0644, |
65 | .proc_handler = &proc_dointvec_minmax, | 60 | .proc_handler = proc_dointvec_minmax, |
66 | .extra1 = (void *) &zero, | 61 | .extra1 = (void *) &zero, |
67 | .extra2 = (void *) &max, | 62 | .extra2 = (void *) &max, |
68 | }, | 63 | }, |
69 | { .ctl_name = 0 } | 64 | { } |
70 | }; | 65 | }; |
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c index 5ae3a571559f..8346938809b1 100644 --- a/security/tomoyo/file.c +++ b/security/tomoyo/file.c | |||
@@ -1096,27 +1096,6 @@ static int tomoyo_check_single_path_permission2(struct tomoyo_domain_info * | |||
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | /** | 1098 | /** |
1099 | * tomoyo_check_file_perm - Check permission for sysctl()'s "read" and "write". | ||
1100 | * | ||
1101 | * @domain: Pointer to "struct tomoyo_domain_info". | ||
1102 | * @filename: Filename to check. | ||
1103 | * @perm: Mode ("read" or "write" or "read/write"). | ||
1104 | * Returns 0 on success, negative value otherwise. | ||
1105 | */ | ||
1106 | int tomoyo_check_file_perm(struct tomoyo_domain_info *domain, | ||
1107 | const char *filename, const u8 perm) | ||
1108 | { | ||
1109 | struct tomoyo_path_info name; | ||
1110 | const u8 mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE); | ||
1111 | |||
1112 | if (!mode) | ||
1113 | return 0; | ||
1114 | name.name = filename; | ||
1115 | tomoyo_fill_path_info(&name); | ||
1116 | return tomoyo_check_file_perm2(domain, &name, perm, "sysctl", mode); | ||
1117 | } | ||
1118 | |||
1119 | /** | ||
1120 | * tomoyo_check_exec_perm - Check permission for "execute". | 1099 | * tomoyo_check_exec_perm - Check permission for "execute". |
1121 | * | 1100 | * |
1122 | * @domain: Pointer to "struct tomoyo_domain_info". | 1101 | * @domain: Pointer to "struct tomoyo_domain_info". |
diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c index 917f564cdab1..18369d497eb8 100644 --- a/security/tomoyo/realpath.c +++ b/security/tomoyo/realpath.c | |||
@@ -110,6 +110,15 @@ int tomoyo_realpath_from_path2(struct path *path, char *newname, | |||
110 | spin_unlock(&dcache_lock); | 110 | spin_unlock(&dcache_lock); |
111 | path_put(&root); | 111 | path_put(&root); |
112 | path_put(&ns_root); | 112 | path_put(&ns_root); |
113 | /* Prepend "/proc" prefix if using internal proc vfs mount. */ | ||
114 | if (!IS_ERR(sp) && (path->mnt->mnt_parent == path->mnt) && | ||
115 | (strcmp(path->mnt->mnt_sb->s_type->name, "proc") == 0)) { | ||
116 | sp -= 5; | ||
117 | if (sp >= newname) | ||
118 | memcpy(sp, "/proc", 5); | ||
119 | else | ||
120 | sp = ERR_PTR(-ENOMEM); | ||
121 | } | ||
113 | } | 122 | } |
114 | if (IS_ERR(sp)) | 123 | if (IS_ERR(sp)) |
115 | error = PTR_ERR(sp); | 124 | error = PTR_ERR(sp); |
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c index 9548a0984cc4..8a00ade85166 100644 --- a/security/tomoyo/tomoyo.c +++ b/security/tomoyo/tomoyo.c | |||
@@ -85,83 +85,6 @@ static int tomoyo_bprm_check_security(struct linux_binprm *bprm) | |||
85 | return tomoyo_check_open_permission(domain, &bprm->file->f_path, 1); | 85 | return tomoyo_check_open_permission(domain, &bprm->file->f_path, 1); |
86 | } | 86 | } |
87 | 87 | ||
88 | #ifdef CONFIG_SYSCTL | ||
89 | |||
90 | static int tomoyo_prepend(char **buffer, int *buflen, const char *str) | ||
91 | { | ||
92 | int namelen = strlen(str); | ||
93 | |||
94 | if (*buflen < namelen) | ||
95 | return -ENOMEM; | ||
96 | *buflen -= namelen; | ||
97 | *buffer -= namelen; | ||
98 | memcpy(*buffer, str, namelen); | ||
99 | return 0; | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | * tomoyo_sysctl_path - return the realpath of a ctl_table. | ||
104 | * @table: pointer to "struct ctl_table". | ||
105 | * | ||
106 | * Returns realpath(3) of the @table on success. | ||
107 | * Returns NULL on failure. | ||
108 | * | ||
109 | * This function uses tomoyo_alloc(), so the caller must call tomoyo_free() | ||
110 | * if this function didn't return NULL. | ||
111 | */ | ||
112 | static char *tomoyo_sysctl_path(struct ctl_table *table) | ||
113 | { | ||
114 | int buflen = TOMOYO_MAX_PATHNAME_LEN; | ||
115 | char *buf = tomoyo_alloc(buflen); | ||
116 | char *end = buf + buflen; | ||
117 | int error = -ENOMEM; | ||
118 | |||
119 | if (!buf) | ||
120 | return NULL; | ||
121 | |||
122 | *--end = '\0'; | ||
123 | buflen--; | ||
124 | while (table) { | ||
125 | char num[32]; | ||
126 | const char *sp = table->procname; | ||
127 | |||
128 | if (!sp) { | ||
129 | memset(num, 0, sizeof(num)); | ||
130 | snprintf(num, sizeof(num) - 1, "=%d=", table->ctl_name); | ||
131 | sp = num; | ||
132 | } | ||
133 | if (tomoyo_prepend(&end, &buflen, sp) || | ||
134 | tomoyo_prepend(&end, &buflen, "/")) | ||
135 | goto out; | ||
136 | table = table->parent; | ||
137 | } | ||
138 | if (tomoyo_prepend(&end, &buflen, "/proc/sys")) | ||
139 | goto out; | ||
140 | error = tomoyo_encode(buf, end - buf, end); | ||
141 | out: | ||
142 | if (!error) | ||
143 | return buf; | ||
144 | tomoyo_free(buf); | ||
145 | return NULL; | ||
146 | } | ||
147 | |||
148 | static int tomoyo_sysctl(struct ctl_table *table, int op) | ||
149 | { | ||
150 | int error; | ||
151 | char *name; | ||
152 | |||
153 | op &= MAY_READ | MAY_WRITE; | ||
154 | if (!op) | ||
155 | return 0; | ||
156 | name = tomoyo_sysctl_path(table); | ||
157 | if (!name) | ||
158 | return -ENOMEM; | ||
159 | error = tomoyo_check_file_perm(tomoyo_domain(), name, op); | ||
160 | tomoyo_free(name); | ||
161 | return error; | ||
162 | } | ||
163 | #endif | ||
164 | |||
165 | static int tomoyo_path_truncate(struct path *path, loff_t length, | 88 | static int tomoyo_path_truncate(struct path *path, loff_t length, |
166 | unsigned int time_attrs) | 89 | unsigned int time_attrs) |
167 | { | 90 | { |
@@ -282,9 +205,6 @@ static struct security_operations tomoyo_security_ops = { | |||
282 | .cred_transfer = tomoyo_cred_transfer, | 205 | .cred_transfer = tomoyo_cred_transfer, |
283 | .bprm_set_creds = tomoyo_bprm_set_creds, | 206 | .bprm_set_creds = tomoyo_bprm_set_creds, |
284 | .bprm_check_security = tomoyo_bprm_check_security, | 207 | .bprm_check_security = tomoyo_bprm_check_security, |
285 | #ifdef CONFIG_SYSCTL | ||
286 | .sysctl = tomoyo_sysctl, | ||
287 | #endif | ||
288 | .file_fcntl = tomoyo_file_fcntl, | 208 | .file_fcntl = tomoyo_file_fcntl, |
289 | .dentry_open = tomoyo_dentry_open, | 209 | .dentry_open = tomoyo_dentry_open, |
290 | .path_truncate = tomoyo_path_truncate, | 210 | .path_truncate = tomoyo_path_truncate, |
diff --git a/security/tomoyo/tomoyo.h b/security/tomoyo/tomoyo.h index cd6ba0bf7069..ed758325b1ae 100644 --- a/security/tomoyo/tomoyo.h +++ b/security/tomoyo/tomoyo.h | |||
@@ -18,8 +18,6 @@ struct inode; | |||
18 | struct linux_binprm; | 18 | struct linux_binprm; |
19 | struct pt_regs; | 19 | struct pt_regs; |
20 | 20 | ||
21 | int tomoyo_check_file_perm(struct tomoyo_domain_info *domain, | ||
22 | const char *filename, const u8 perm); | ||
23 | int tomoyo_check_exec_perm(struct tomoyo_domain_info *domain, | 21 | int tomoyo_check_exec_perm(struct tomoyo_domain_info *domain, |
24 | const struct tomoyo_path_info *filename); | 22 | const struct tomoyo_path_info *filename); |
25 | int tomoyo_check_open_permission(struct tomoyo_domain_info *domain, | 23 | int tomoyo_check_open_permission(struct tomoyo_domain_info *domain, |