|
@@ -327,16 +327,10 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net,
|
|
|
|
|
|
tmpl->status = IPS_TEMPLATE;
|
|
|
write_pnet(&tmpl->ct_net, net);
|
|
|
-
|
|
|
- if (nf_ct_zone_add(tmpl, flags, zone) < 0)
|
|
|
- goto out_free;
|
|
|
-
|
|
|
+ nf_ct_zone_add(tmpl, zone);
|
|
|
atomic_set(&tmpl->ct_general.use, 0);
|
|
|
|
|
|
return tmpl;
|
|
|
-out_free:
|
|
|
- kfree(tmpl);
|
|
|
- return NULL;
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(nf_ct_tmpl_alloc);
|
|
|
|
|
@@ -929,16 +923,13 @@ __nf_conntrack_alloc(struct net *net,
|
|
|
offsetof(struct nf_conn, proto) -
|
|
|
offsetof(struct nf_conn, __nfct_init_offset[0]));
|
|
|
|
|
|
- if (zone && nf_ct_zone_add(ct, GFP_ATOMIC, zone) < 0)
|
|
|
- goto out_free;
|
|
|
+ nf_ct_zone_add(ct, zone);
|
|
|
|
|
|
/* Because we use RCU lookups, we set ct_general.use to zero before
|
|
|
* this is inserted in any list.
|
|
|
*/
|
|
|
atomic_set(&ct->ct_general.use, 0);
|
|
|
return ct;
|
|
|
-out_free:
|
|
|
- kmem_cache_free(nf_conntrack_cachep, ct);
|
|
|
out:
|
|
|
atomic_dec(&net->ct.count);
|
|
|
return ERR_PTR(-ENOMEM);
|
|
@@ -1342,14 +1333,6 @@ bool __nf_ct_kill_acct(struct nf_conn *ct,
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(__nf_ct_kill_acct);
|
|
|
|
|
|
-#ifdef CONFIG_NF_CONNTRACK_ZONES
|
|
|
-static struct nf_ct_ext_type nf_ct_zone_extend __read_mostly = {
|
|
|
- .len = sizeof(struct nf_conntrack_zone),
|
|
|
- .align = __alignof__(struct nf_conntrack_zone),
|
|
|
- .id = NF_CT_EXT_ZONE,
|
|
|
-};
|
|
|
-#endif
|
|
|
-
|
|
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
|
|
|
|
|
|
#include <linux/netfilter/nfnetlink.h>
|
|
@@ -1532,9 +1515,6 @@ void nf_conntrack_cleanup_end(void)
|
|
|
|
|
|
nf_ct_free_hashtable(nf_conntrack_hash, nf_conntrack_htable_size);
|
|
|
|
|
|
-#ifdef CONFIG_NF_CONNTRACK_ZONES
|
|
|
- nf_ct_extend_unregister(&nf_ct_zone_extend);
|
|
|
-#endif
|
|
|
nf_conntrack_proto_fini();
|
|
|
nf_conntrack_seqadj_fini();
|
|
|
nf_conntrack_labels_fini();
|
|
@@ -1771,11 +1751,6 @@ int nf_conntrack_init_start(void)
|
|
|
if (ret < 0)
|
|
|
goto err_seqadj;
|
|
|
|
|
|
-#ifdef CONFIG_NF_CONNTRACK_ZONES
|
|
|
- ret = nf_ct_extend_register(&nf_ct_zone_extend);
|
|
|
- if (ret < 0)
|
|
|
- goto err_extend;
|
|
|
-#endif
|
|
|
ret = nf_conntrack_proto_init();
|
|
|
if (ret < 0)
|
|
|
goto err_proto;
|
|
@@ -1791,10 +1766,6 @@ int nf_conntrack_init_start(void)
|
|
|
return 0;
|
|
|
|
|
|
err_proto:
|
|
|
-#ifdef CONFIG_NF_CONNTRACK_ZONES
|
|
|
- nf_ct_extend_unregister(&nf_ct_zone_extend);
|
|
|
-err_extend:
|
|
|
-#endif
|
|
|
nf_conntrack_seqadj_fini();
|
|
|
err_seqadj:
|
|
|
nf_conntrack_labels_fini();
|