Skip to content

Commit

Permalink
[NETNS]: Use the per-net ipv6_devconf_dflt
Browse files Browse the repository at this point in the history
All its users are in net/ipv6/addrconf.c's sysctl handlers.
Since they already have the struct net to get from, the
per-net ipv6_devconf_dflt can already be used.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent e0da5a4 commit 441fc2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)

rwlock_init(&ndev->lock);
ndev->dev = dev;
memcpy(&ndev->cnf, &ipv6_devconf_dflt, sizeof(ndev->cnf));
memcpy(&ndev->cnf, dev->nd_net->ipv6.devconf_dflt, sizeof(ndev->cnf));
ndev->cnf.mtu6 = dev->mtu;
ndev->cnf.sysctl = NULL;
ndev->nd_parms = neigh_parms_alloc(dev, &nd_tbl);
Expand Down Expand Up @@ -481,11 +481,11 @@ static void addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
struct net *net;

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

if (p == &ipv6_devconf.forwarding) {
ipv6_devconf_dflt.forwarding = ipv6_devconf.forwarding;
net->ipv6.devconf_dflt->forwarding = ipv6_devconf.forwarding;
addrconf_forward_change(net);
} else if ((!*p) ^ (!old))
dev_forward_change((struct inet6_dev *)table->extra1);
Expand Down

0 comments on commit 441fc2a

Please sign in to comment.