Commit 328bb78c authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV6] NDISC: NEWLINK notification on change of Reachable Time

Signed-off-by: default avatarHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
parent 2ee7b6bf
......@@ -2215,9 +2215,14 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
t->neigh_vars[2].data = &p->app_probes;
t->neigh_vars[3].data = &p->retrans_time;
if (handler || strategy) {
/* RetransTime */
t->neigh_vars[3].proc_handler = handler;
t->neigh_vars[3].strategy = strategy;
t->neigh_vars[3].extra1 = dev;
/* ReachableTime */
t->neigh_vars[4].proc_handler = handler;
t->neigh_vars[4].strategy = strategy;
t->neigh_vars[4].extra1 = dev;
}
t->neigh_vars[4].data = &p->base_reachable_time;
t->neigh_vars[5].data = &p->delay_probe_time;
......
......@@ -1542,7 +1542,17 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
struct inet6_dev *idev;
int ret;
switch (ctl->ctl_name) {
case NET_NEIGH_RETRANS_TIME:
ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
break;
case NET_NEIGH_REACHABLE_TIME:
ret = proc_dointvec_jiffies(ctl, write,
filp, buffer, lenp, ppos);
break;
default:
ret = -1;
}
if (write && ret == 0 && dev && (idev = in6_dev_get(dev)) != NULL) {
idev->tstamp = jiffies;
......@@ -1551,6 +1561,36 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
}
return ret;
}
int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen,
void **context)
{
struct net_device *dev = ctl->extra1;
struct inet6_dev *idev;
int ret;
switch (ctl->ctl_name) {
case NET_NEIGH_REACHABLE_TIME:
ret = sysctl_jiffies(ctl, name, nlen,
oldval, oldlenp, newval, newlen,
context);
break;
default:
ret = 0;
}
if (newval && newlen && ret > 0 &&
dev && (idev = in6_dev_get(dev)) != NULL) {
idev->tstamp = jiffies;
inet6_ifinfo_notify(RTM_NEWLINK, idev);
in6_dev_put(idev);
}
return ret;
}
#endif
int __init ndisc_init(struct net_proto_family *ops)
......@@ -1584,7 +1624,9 @@ int __init ndisc_init(struct net_proto_family *ops)
#ifdef CONFIG_SYSCTL
neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH,
"ipv6", &ndisc_ifinfo_sysctl_change, NULL);
"ipv6",
&ndisc_ifinfo_sysctl_change,
&ndisc_ifinfo_sysctl_strategy);
#endif
register_netdevice_notifier(&ndisc_netdev_notifier);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment