diff options
Diffstat (limited to 'net/ipv6/ndisc.c')
-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); |