コード例 #1
0
static void nf_ct_l4proto_unregister_sysctl(struct nf_conntrack_l4proto *l4proto)
{
#ifdef CONFIG_SYSCTL
    if (l4proto->ctl_table_header != NULL &&
            *l4proto->ctl_table_header != NULL)
        nf_ct_unregister_sysctl(l4proto->ctl_table_header,
                                l4proto->ctl_table,
                                l4proto->ctl_table_users);
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
    if (l4proto->ctl_compat_table_header != NULL)
        nf_ct_unregister_sysctl(&l4proto->ctl_compat_table_header,
                                l4proto->ctl_compat_table, NULL);
#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
#endif /* CONFIG_SYSCTL */
}
コード例 #2
0
static int nf_ct_l4proto_register_sysctl(struct nf_conntrack_l4proto *l4proto)
{
    int err = 0;

#ifdef CONFIG_SYSCTL
    if (l4proto->ctl_table != NULL) {
        err = nf_ct_register_sysctl(l4proto->ctl_table_header,
                                    nf_net_netfilter_sysctl_path,
                                    l4proto->ctl_table,
                                    l4proto->ctl_table_users);
        if (err < 0)
            goto out;
    }
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
    if (l4proto->ctl_compat_table != NULL) {
        err = nf_ct_register_sysctl(&l4proto->ctl_compat_table_header,
                                    nf_net_ipv4_netfilter_sysctl_path,
                                    l4proto->ctl_compat_table, NULL);
        if (err == 0)
            goto out;
        nf_ct_unregister_sysctl(l4proto->ctl_table_header,
                                l4proto->ctl_table,
                                l4proto->ctl_table_users);
    }
#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
out:
#endif /* CONFIG_SYSCTL */
    return err;
}
コード例 #3
0
static void nf_ct_l3proto_unregister_sysctl(struct nf_conntrack_l3proto *l3proto)
{
#ifdef CONFIG_SYSCTL
    if (l3proto->ctl_table_header != NULL)
        nf_ct_unregister_sysctl(&l3proto->ctl_table_header,
                                l3proto->ctl_table, NULL);
#endif
}
コード例 #4
0
static
void nf_ct_l4proto_unregister_sysctl(struct net *net,
				     struct nf_proto_net *pn,
				     struct nf_conntrack_l4proto *l4proto)
{
#ifdef CONFIG_SYSCTL
	if (pn->ctl_table_header != NULL)
		nf_ct_unregister_sysctl(&pn->ctl_table_header,
					&pn->ctl_table,
					pn->users);

#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
	if (l4proto->l3proto != AF_INET6 && pn->ctl_compat_header != NULL)
		nf_ct_unregister_sysctl(&pn->ctl_compat_header,
					&pn->ctl_compat_table,
					0);
#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
#endif /* CONFIG_SYSCTL */
}
コード例 #5
0
static
void nf_ct_l4proto_unregister_sysctl(struct net *net,
				struct nf_proto_net *pn,
				const struct nf_conntrack_l4proto *l4proto)
{
#ifdef CONFIG_SYSCTL
	if (pn->ctl_table_header != NULL)
		nf_ct_unregister_sysctl(&pn->ctl_table_header,
					&pn->ctl_table,
					pn->users);
#endif /* CONFIG_SYSCTL */
}
コード例 #6
0
static void nf_ct_l3proto_unregister_sysctl(struct net *net,
					    struct nf_conntrack_l3proto *l3proto)
{
	struct nf_ip_net *in = nf_ct_l3proto_net(net, l3proto);

	if (in == NULL)
		return;
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
	if (in->ctl_table_header != NULL)
		nf_ct_unregister_sysctl(&in->ctl_table_header,
					&in->ctl_table,
					0);
#endif
}
コード例 #7
0
static
int nf_ct_l4proto_register_sysctl(struct net *net,
				  struct nf_proto_net *pn,
				  struct nf_conntrack_l4proto *l4proto)
{
	int err = 0;

#ifdef CONFIG_SYSCTL
	if (pn->ctl_table != NULL) {
		err = nf_ct_register_sysctl(net,
					    &pn->ctl_table_header,
					    "net/netfilter",
					    pn->ctl_table);
		if (err < 0) {
			if (!pn->users) {
				kfree(pn->ctl_table);
				pn->ctl_table = NULL;
			}
		}
	}
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
	if (l4proto->l3proto != AF_INET6 && pn->ctl_compat_table != NULL) {
		if (err < 0) {
			nf_ct_kfree_compat_sysctl_table(pn);
			goto out;
		}
		err = nf_ct_register_sysctl(net,
					    &pn->ctl_compat_header,
					    "net/ipv4/netfilter",
					    pn->ctl_compat_table);
		if (err == 0)
			goto out;

		nf_ct_kfree_compat_sysctl_table(pn);
		nf_ct_unregister_sysctl(&pn->ctl_table_header,
					&pn->ctl_table,
					pn->users);
	}
out:
#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
#endif /* CONFIG_SYSCTL */
	return err;
}