Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102599
b: refs/heads/master
c: 34ac257
h: refs/heads/master
i:
  102597: fdc13d0
  102595: a548a00
  102591: b01f0dd
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed May 19, 2008
1 parent 593bccd commit ef0ff37
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 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: 7d291ebb834278e30c211b26fb7076adcb636ad9
refs/heads/master: 34ac2573e88c4f80fc5e219d8012ea383a788803
29 changes: 22 additions & 7 deletions trunk/net/ipv6/sysctl_net_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ static ctl_table ipv6_table_template[] = {
.mode = 0644,
.proc_handler = &proc_dointvec
},
{ .ctl_name = 0 }
};

static ctl_table ipv6_table[] = {
{
.ctl_name = NET_IPV6_MLD_MAX_MSF,
.procname = "mld_max_msf",
Expand Down Expand Up @@ -80,12 +84,6 @@ static int ipv6_sysctl_net_init(struct net *net)

ipv6_table[2].data = &net->ipv6.sysctl.bindv6only;

/* We don't want this value to be per namespace, it should be global
to all namespaces, so make it read-only when we are not in the
init network namespace */
if (net != &init_net)
ipv6_table[3].mode = 0444;

net->ipv6.sysctl.table = register_net_sysctl_table(net, net_ipv6_ctl_path,
ipv6_table);
if (!net->ipv6.sysctl.table)
Expand Down Expand Up @@ -126,12 +124,29 @@ static struct pernet_operations ipv6_sysctl_net_ops = {
.exit = ipv6_sysctl_net_exit,
};

static struct ctl_table_header *ip6_header;

int ipv6_sysctl_register(void)
{
return register_pernet_subsys(&ipv6_sysctl_net_ops);
int err = -ENOMEM;;

ip6_header = register_net_sysctl_rotable(net_ipv6_ctl_path, ipv6_table);
if (ip6_header == NULL)
goto out;

err = register_pernet_subsys(&ipv6_sysctl_net_ops);
if (err)
goto err_pernet;
out:
return err;

err_pernet:
unregister_net_sysctl_table(ip6_header);
goto out;
}

void ipv6_sysctl_unregister(void)
{
unregister_net_sysctl_table(ip6_header);
unregister_pernet_subsys(&ipv6_sysctl_net_ops);
}

0 comments on commit ef0ff37

Please sign in to comment.