Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78260
b: refs/heads/master
c: f52295a
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent 8b3244b commit 085f6fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 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: bfada697bd534d2c16fd07fbef3a4924c4d4e014
refs/heads/master: f52295a9c55ccb4d9b3580ce889f958ac740a44b
32 changes: 16 additions & 16 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
#define TIME_DELTA(a,b) ((unsigned long)((long)(a) - (long)(b)))

#ifdef CONFIG_SYSCTL
static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p);
static void addrconf_sysctl_register(struct inet6_dev *idev);
static void addrconf_sysctl_unregister(struct ipv6_devconf *p);
#endif

Expand Down Expand Up @@ -400,7 +400,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
NET_IPV6_NEIGH, "ipv6",
&ndisc_ifinfo_sysctl_change,
NULL);
addrconf_sysctl_register(ndev, &ndev->cnf);
addrconf_sysctl_register(ndev);
#endif
/* protected by rtnl_lock */
rcu_assign_pointer(dev->ip6_ptr, ndev);
Expand Down Expand Up @@ -2386,7 +2386,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
NET_IPV6, NET_IPV6_NEIGH, "ipv6",
&ndisc_ifinfo_sysctl_change,
NULL);
addrconf_sysctl_register(idev, &idev->cnf);
addrconf_sysctl_register(idev);
#endif
err = snmp6_register_dev(idev);
if (err)
Expand Down Expand Up @@ -4118,12 +4118,11 @@ static struct addrconf_sysctl_table
},
};

static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf *p)
static void __addrconf_sysctl_register(char *dev_name, int ctl_name,
struct inet6_dev *idev, struct ipv6_devconf *p)
{
int i;
struct net_device *dev = idev ? idev->dev : NULL;
struct addrconf_sysctl_table *t;
char *dev_name = NULL;

t = kmemdup(&addrconf_sysctl, sizeof(*t), GFP_KERNEL);
if (t == NULL)
Expand All @@ -4133,13 +4132,6 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf
t->addrconf_vars[i].data += (char*)p - (char*)&ipv6_devconf;
t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */
}
if (dev) {
dev_name = dev->name;
t->addrconf_dev[0].ctl_name = dev->ifindex;
} else {
dev_name = "default";
t->addrconf_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT;
}

/*
* Make a copy of dev_name, because '.procname' is regarded as const
Expand All @@ -4150,6 +4142,7 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf
if (!dev_name)
goto free;

t->addrconf_dev[0].ctl_name = ctl_name;
t->addrconf_dev[0].procname = dev_name;

t->addrconf_dev[0].child = t->addrconf_vars;
Expand All @@ -4172,6 +4165,12 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf
return;
}

static void addrconf_sysctl_register(struct inet6_dev *idev)
{
__addrconf_sysctl_register(idev->dev->name, idev->dev->ifindex,
idev, &idev->cnf);
}

static void addrconf_sysctl_unregister(struct ipv6_devconf *p)
{
if (p->sysctl) {
Expand Down Expand Up @@ -4270,9 +4269,10 @@ int __init addrconf_init(void)
ipv6_addr_label_rtnl_register();

#ifdef CONFIG_SYSCTL
addrconf_sysctl.sysctl_header =
register_sysctl_table(addrconf_sysctl.addrconf_root_dir);
addrconf_sysctl_register(NULL, &ipv6_devconf_dflt);
__addrconf_sysctl_register("all", NET_PROTO_CONF_ALL,
NULL, &ipv6_devconf);
__addrconf_sysctl_register("default", NET_PROTO_CONF_DEFAULT,
NULL, &ipv6_devconf_dflt);
#endif

return 0;
Expand Down

0 comments on commit 085f6fc

Please sign in to comment.