コード例 #1
0
static int udp_init_net(struct net *net, u_int16_t proto)
{
	int ret;
	struct nf_udp_net *un = udp_pernet(net);
	struct nf_proto_net *pn = &un->pn;

	if (!pn->users) {
		int i;

		for (i = 0; i < UDP_CT_MAX; i++)
			un->timeouts[i] = udp_timeouts[i];
	}

	if (proto == AF_INET) {
		ret = udp_kmemdup_compat_sysctl_table(pn, un);
		if (ret < 0)
			return ret;

		ret = udp_kmemdup_sysctl_table(pn, un);
		if (ret < 0)
			nf_ct_kfree_compat_sysctl_table(pn);
	} else
		ret = udp_kmemdup_sysctl_table(pn, un);

	return ret;
}
コード例 #2
0
static int udp_init_net(struct net *net, u_int16_t proto)
{
	struct nf_udp_net *un = udp_pernet(net);
	struct nf_proto_net *pn = &un->pn;

	if (!pn->users) {
		int i;

		for (i = 0; i < UDP_CT_MAX; i++)
			un->timeouts[i] = udp_timeouts[i];
	}

	return udp_kmemdup_sysctl_table(pn, un);
}