コード例 #1
0
ファイル: xfrm6_policy.c プロジェクト: 325116067/semc-qsd8x50
int __init xfrm6_init(void)
{
	int ret;
	unsigned int gc_thresh;

	ret = xfrm6_policy_init();
	if (ret)
		goto out;

	ret = xfrm6_state_init();
	if (ret)
		goto out_policy;
	/*
	 * We need a good default value for the xfrm6 gc threshold.
	 * In ipv4 we set it to the route hash table size * 8, which
	 * is half the size of the maximaum route cache for ipv4.  It
	 * would be good to do the same thing for v6, except the table is
	 * constructed differently here.  Here each table for a net namespace
	 * can have FIB_TABLE_HASHSZ entries, so lets go with the same
	 * computation that we used for ipv4 here.  Also, lets keep the initial
	 * gc_thresh to a minimum of 1024, since, the ipv6 route cache defaults
	 * to that as a minimum as well
	 */
	gc_thresh = FIB6_TABLE_HASHSZ * 8;
	xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh;
#ifdef CONFIG_SYSCTL
	sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path,
						xfrm6_policy_table);
#endif
out:
	return ret;
out_policy:
	xfrm6_policy_fini();
	goto out;
}
コード例 #2
0
int __init xfrm6_init(void)
{
	int ret;
	unsigned int gc_thresh;

	gc_thresh = FIB6_TABLE_HASHSZ * 8;
	xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh;
	dst_entries_init(&xfrm6_dst_ops);

	ret = xfrm6_policy_init();
	if (ret) {
		dst_entries_destroy(&xfrm6_dst_ops);
		goto out;
	}
	ret = xfrm6_state_init();
	if (ret)
		goto out_policy;

#ifdef CONFIG_SYSCTL
	sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path,
						xfrm6_policy_table);
#endif
out:
	return ret;
out_policy:
	xfrm6_policy_fini();
	goto out;
}
コード例 #3
0
ファイル: xfrm6_policy.c プロジェクト: 19Dan01/linux
int __init xfrm6_init(void)
{
	int ret;

	dst_entries_init(&xfrm6_dst_ops);

	ret = xfrm6_policy_init();
	if (ret) {
		dst_entries_destroy(&xfrm6_dst_ops);
		goto out;
	}
	ret = xfrm6_state_init();
	if (ret)
		goto out_policy;

	ret = xfrm6_protocol_init();
	if (ret)
		goto out_state;

#ifdef CONFIG_SYSCTL
	register_pernet_subsys(&xfrm6_net_ops);
#endif
out:
	return ret;
out_state:
	xfrm6_state_fini();
out_policy:
	xfrm6_policy_fini();
	goto out;
}
コード例 #4
0
int __init xfrm6_init(void)
{
	int ret;

	dst_entries_init(&xfrm6_dst_ops);

	ret = xfrm6_policy_init();
	if (ret) {
		dst_entries_destroy(&xfrm6_dst_ops);
		goto out;
	}
	ret = xfrm6_state_init();
	if (ret)
		goto out_policy;

#ifdef CONFIG_SYSCTL
	sysctl_hdr = register_net_sysctl(&init_net, "net/ipv6",
					 xfrm6_policy_table);
#endif
out:
	return ret;
out_policy:
	xfrm6_policy_fini();
	goto out;
}
コード例 #5
0
ファイル: xfrm6_policy.c プロジェクト: AppEngine/linux-2.6
int __init xfrm6_init(void)
{
	int ret;

	ret = xfrm6_policy_init();
	if (ret)
		goto out;

	ret = xfrm6_state_init();
	if (ret)
		goto out_policy;
out:
	return ret;
out_policy:
	xfrm6_policy_fini();
	goto out;
}
コード例 #6
0
void __init xfrm6_init(void)
{
	xfrm6_policy_init();
	xfrm6_state_init();
}