Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132130
b: refs/heads/master
c: b325fdd
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 3, 2009
1 parent 4d0c7bc commit bcf245a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a5990d3090b03745a9548a6f5edef02095675cf
refs/heads/master: b325fddb7f869e6c95a88dc6573220f162e5b89f
14 changes: 8 additions & 6 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,17 @@ static void addrconf_forward_change(struct net *net, __s32 newf)
read_unlock(&dev_base_lock);
}

static void addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
{
struct net *net;

net = (struct net *)table->extra2;
if (p == &net->ipv6.devconf_dflt->forwarding)
return;
return 0;

if (!rtnl_trylock())
return -ERESTARTSYS;

rtnl_lock();
if (p == &net->ipv6.devconf_all->forwarding) {
__s32 newf = net->ipv6.devconf_all->forwarding;
net->ipv6.devconf_dflt->forwarding = newf;
Expand All @@ -512,6 +514,7 @@ static void addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)

if (*p)
rt6_purge_dflt_routers(net);
return 1;
}
#endif

Expand Down Expand Up @@ -3983,7 +3986,7 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);

if (write)
addrconf_fixup_forwarding(ctl, valp, val);
ret = addrconf_fixup_forwarding(ctl, valp, val);
return ret;
}

Expand Down Expand Up @@ -4019,8 +4022,7 @@ static int addrconf_sysctl_forward_strategy(ctl_table *table,
}

*valp = new;
addrconf_fixup_forwarding(table, valp, val);
return 1;
return addrconf_fixup_forwarding(table, valp, val);
}

static struct addrconf_sysctl_table
Expand Down

0 comments on commit bcf245a

Please sign in to comment.