Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159223
b: refs/heads/master
c: a44a4a0
h: refs/heads/master
i:
  159221: 71f4f48
  159219: 92fde63
  159215: 2aade96
v: v3
  • Loading branch information
Neil Horman authored and David S. Miller committed Jul 27, 2009
1 parent 6ffa2f5 commit 43bd141
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a729fce76f7af50d8b622f2fb26adce9c8df743
refs/heads/master: a44a4a006b860476881ec0098c36584036e1cb91
18 changes: 18 additions & 0 deletions trunk/net/ipv4/xfrm4_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,37 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
.fill_dst = xfrm4_fill_dst,
};

static struct ctl_table xfrm4_policy_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "xfrm4_gc_thresh",
.data = &xfrm4_dst_ops.gc_thresh,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{ }
};

static struct ctl_table_header *sysctl_hdr;

static void __init xfrm4_policy_init(void)
{
xfrm_policy_register_afinfo(&xfrm4_policy_afinfo);
}

static void __exit xfrm4_policy_fini(void)
{
if (sysctl_hdr)
unregister_net_sysctl_table(sysctl_hdr);
xfrm_policy_unregister_afinfo(&xfrm4_policy_afinfo);
}

void __init xfrm4_init(void)
{
xfrm4_state_init();
xfrm4_policy_init();
sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv4_ctl_path,
xfrm4_policy_table);
}

18 changes: 18 additions & 0 deletions trunk/net/ipv6/xfrm6_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,20 @@ static void xfrm6_policy_fini(void)
xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo);
}

static struct ctl_table xfrm6_policy_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "xfrm6_gc_thresh",
.data = &xfrm6_dst_ops.gc_thresh,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{ }
};

static struct ctl_table_header *sysctl_hdr;

int __init xfrm6_init(void)
{
int ret;
Expand All @@ -317,6 +331,8 @@ int __init xfrm6_init(void)
ret = xfrm6_state_init();
if (ret)
goto out_policy;
sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path,
xfrm6_policy_table);
out:
return ret;
out_policy:
Expand All @@ -326,6 +342,8 @@ int __init xfrm6_init(void)

void xfrm6_fini(void)
{
if (sysctl_hdr)
unregister_net_sysctl_table(sysctl_hdr);
//xfrm6_input_fini();
xfrm6_policy_fini();
xfrm6_state_fini();
Expand Down

0 comments on commit 43bd141

Please sign in to comment.