diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-25 23:22:42 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-25 23:22:42 -0800 |
commit | 04488734806948624dabc4514f96f14cd75b9a50 (patch) | |
tree | 74f3a3c10a7177a5f86398b83ad7bf0569fe8b89 /net/ipv4 | |
parent | 54831a83bfe656c4c54e287c734c6b0ccaa3719b (diff) | |
parent | c4d49794ff2838038fd9756eae39c39a5a685833 (diff) | |
download | blackbird-op-linux-04488734806948624dabc4514f96f14cd75b9a50.tar.gz blackbird-op-linux-04488734806948624dabc4514f96f14cd75b9a50.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/devinet.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 014982b61564..51ca946e3392 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1317,14 +1317,19 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, { int *valp = ctl->data; int val = *valp; + loff_t pos = *ppos; int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); if (write && *valp != val) { struct net *net = ctl->extra2; if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) { - if (!rtnl_trylock()) + if (!rtnl_trylock()) { + /* Restore the original values before restarting */ + *valp = val; + *ppos = pos; return restart_syscall(); + } if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) { inet_forward_change(net); } else if (*valp) { |