diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2007-10-18 06:05:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:22 -0400 |
commit | d12af679bcf8995a237560bdf7a4d734f8df5dbb (patch) | |
tree | 9cb821d20fa8be39ff4954d7e8f5966ef9d3b7dd /net/ipv6 | |
parent | f5ead5cefc1129d5f001728004ed0f38d5875c02 (diff) |
sysctl: fix neighbour table sysctls.
- In ipv6 ndisc_ifinfo_syctl_change so it doesn't depend on binary
sysctl names for a function that works with proc.
- In neighbour.c reorder the table to put the possibly unused entries
at the end so we can remove them by terminating the table early.
- In neighbour.c kill the entries with questionable binary sysctl
handling behavior.
- In neighbour.c if we don't have a strategy routine remove the
binary path. So we don't the default sysctl strategy routine
on data that is not ready for it.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Alexey Dobriyan <adobriyan@sw.ru>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ndisc.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 6cc33dc83d1c..20cfc90d5597 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1658,30 +1658,26 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f | |||
1658 | struct inet6_dev *idev; | 1658 | struct inet6_dev *idev; |
1659 | int ret; | 1659 | int ret; |
1660 | 1660 | ||
1661 | if (ctl->ctl_name == NET_NEIGH_RETRANS_TIME || | 1661 | if ((strcmp(ctl->procname, "retrans_time") == 0) || |
1662 | ctl->ctl_name == NET_NEIGH_REACHABLE_TIME) | 1662 | (strcmp(ctl->procname, "base_reachable_time") == 0)) |
1663 | ndisc_warn_deprecated_sysctl(ctl, "syscall", dev ? dev->name : "default"); | 1663 | ndisc_warn_deprecated_sysctl(ctl, "syscall", dev ? dev->name : "default"); |
1664 | 1664 | ||
1665 | switch (ctl->ctl_name) { | 1665 | if (strcmp(ctl->procname, "retrans_time") == 0) |
1666 | case NET_NEIGH_RETRANS_TIME: | ||
1667 | ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); | 1666 | ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); |
1668 | break; | 1667 | |
1669 | case NET_NEIGH_REACHABLE_TIME: | 1668 | else if (strcmp(ctl->procname, "base_reachable_time") == 0) |
1670 | ret = proc_dointvec_jiffies(ctl, write, | 1669 | ret = proc_dointvec_jiffies(ctl, write, |
1671 | filp, buffer, lenp, ppos); | 1670 | filp, buffer, lenp, ppos); |
1672 | break; | 1671 | |
1673 | case NET_NEIGH_RETRANS_TIME_MS: | 1672 | else if ((strcmp(ctl->procname, "retrans_time_ms") == 0) || |
1674 | case NET_NEIGH_REACHABLE_TIME_MS: | 1673 | (strcmp(ctl->procname, "base_reacable_time_ms") == 0)) |
1675 | ret = proc_dointvec_ms_jiffies(ctl, write, | 1674 | ret = proc_dointvec_ms_jiffies(ctl, write, |
1676 | filp, buffer, lenp, ppos); | 1675 | filp, buffer, lenp, ppos); |
1677 | break; | 1676 | else |
1678 | default: | ||
1679 | ret = -1; | 1677 | ret = -1; |
1680 | } | ||
1681 | 1678 | ||
1682 | if (write && ret == 0 && dev && (idev = in6_dev_get(dev)) != NULL) { | 1679 | if (write && ret == 0 && dev && (idev = in6_dev_get(dev)) != NULL) { |
1683 | if (ctl->ctl_name == NET_NEIGH_REACHABLE_TIME || | 1680 | if (ctl->data == &idev->nd_parms->base_reachable_time) |
1684 | ctl->ctl_name == NET_NEIGH_REACHABLE_TIME_MS) | ||
1685 | idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time); | 1681 | idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time); |
1686 | idev->tstamp = jiffies; | 1682 | idev->tstamp = jiffies; |
1687 | inet6_ifinfo_notify(RTM_NEWLINK, idev); | 1683 | inet6_ifinfo_notify(RTM_NEWLINK, idev); |