aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-02-26 02:22:42 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-26 02:22:42 -0500
commit04488734806948624dabc4514f96f14cd75b9a50 (patch)
tree74f3a3c10a7177a5f86398b83ad7bf0569fe8b89 /net/ipv6
parent54831a83bfe656c4c54e287c734c6b0ccaa3719b (diff)
parentc4d49794ff2838038fd9756eae39c39a5a685833 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index b0d4a4b23db5..1b327f15e7e7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -502,8 +502,11 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
502 if (p == &net->ipv6.devconf_dflt->forwarding) 502 if (p == &net->ipv6.devconf_dflt->forwarding)
503 return 0; 503 return 0;
504 504
505 if (!rtnl_trylock()) 505 if (!rtnl_trylock()) {
506 /* Restore the original values before restarting */
507 *p = old;
506 return restart_syscall(); 508 return restart_syscall();
509 }
507 510
508 if (p == &net->ipv6.devconf_all->forwarding) { 511 if (p == &net->ipv6.devconf_all->forwarding) {
509 __s32 newf = net->ipv6.devconf_all->forwarding; 512 __s32 newf = net->ipv6.devconf_all->forwarding;
@@ -4042,12 +4045,15 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
4042{ 4045{
4043 int *valp = ctl->data; 4046 int *valp = ctl->data;
4044 int val = *valp; 4047 int val = *valp;
4048 loff_t pos = *ppos;
4045 int ret; 4049 int ret;
4046 4050
4047 ret = proc_dointvec(ctl, write, buffer, lenp, ppos); 4051 ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
4048 4052
4049 if (write) 4053 if (write)
4050 ret = addrconf_fixup_forwarding(ctl, valp, val); 4054 ret = addrconf_fixup_forwarding(ctl, valp, val);
4055 if (ret)
4056 *ppos = pos;
4051 return ret; 4057 return ret;
4052} 4058}
4053 4059
@@ -4089,8 +4095,11 @@ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int old)
4089 if (p == &net->ipv6.devconf_dflt->disable_ipv6) 4095 if (p == &net->ipv6.devconf_dflt->disable_ipv6)
4090 return 0; 4096 return 0;
4091 4097
4092 if (!rtnl_trylock()) 4098 if (!rtnl_trylock()) {
4099 /* Restore the original values before restarting */
4100 *p = old;
4093 return restart_syscall(); 4101 return restart_syscall();
4102 }
4094 4103
4095 if (p == &net->ipv6.devconf_all->disable_ipv6) { 4104 if (p == &net->ipv6.devconf_all->disable_ipv6) {
4096 __s32 newf = net->ipv6.devconf_all->disable_ipv6; 4105 __s32 newf = net->ipv6.devconf_all->disable_ipv6;
@@ -4109,12 +4118,15 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write,
4109{ 4118{
4110 int *valp = ctl->data; 4119 int *valp = ctl->data;
4111 int val = *valp; 4120 int val = *valp;
4121 loff_t pos = *ppos;
4112 int ret; 4122 int ret;
4113 4123
4114 ret = proc_dointvec(ctl, write, buffer, lenp, ppos); 4124 ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
4115 4125
4116 if (write) 4126 if (write)
4117 ret = addrconf_disable_ipv6(ctl, valp, val); 4127 ret = addrconf_disable_ipv6(ctl, valp, val);
4128 if (ret)
4129 *ppos = pos;
4118 return ret; 4130 return ret;
4119} 4131}
4120 4132