diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2013-01-21 22:10:31 (GMT) |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-01-23 11:56:23 (GMT) |
commit | 5f69b8f5218dc303cbcb6f71d221c27d3cd17ebb (patch) | |
tree | b904cb0d77fe07d3ac67bc7b9f25bbf13c5322ca /net/netfilter/nf_conntrack_core.c | |
parent | 5e615b220087c5551f486c967831cecdfd338dbe (diff) | |
download | linux-5f69b8f5218dc303cbcb6f71d221c27d3cd17ebb.tar.xz |
netfilter: nf_ct_labels: move initialization out of pernet_operations
Move the global initial codes to the module_init/exit context.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_conntrack_core.c')
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 06b8cdb..a4a3bcf 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -1348,6 +1348,7 @@ void nf_conntrack_cleanup_end(void) #ifdef CONFIG_NF_CONNTRACK_ZONES nf_ct_extend_unregister(&nf_ct_zone_extend); #endif + nf_conntrack_labels_fini(); nf_conntrack_helper_fini(); nf_conntrack_timeout_fini(); nf_conntrack_ecache_fini(); @@ -1378,7 +1379,6 @@ void nf_conntrack_cleanup_net(struct net *net) nf_ct_free_hashtable(net->ct.hash, net->ct.htable_size); nf_conntrack_proto_fini(net); - nf_conntrack_labels_fini(net); nf_conntrack_helper_pernet_fini(net); nf_conntrack_ecache_pernet_fini(net); nf_conntrack_tstamp_pernet_fini(net); @@ -1531,6 +1531,10 @@ int nf_conntrack_init_start(void) if (ret < 0) goto err_helper; + ret = nf_conntrack_labels_init(); + if (ret < 0) + goto err_labels; + #ifdef CONFIG_NF_CONNTRACK_ZONES ret = nf_ct_extend_register(&nf_ct_zone_extend); if (ret < 0) @@ -1548,8 +1552,10 @@ int nf_conntrack_init_start(void) #ifdef CONFIG_NF_CONNTRACK_ZONES err_extend: - nf_conntrack_helper_fini(); + nf_conntrack_labels_fini(); #endif +err_labels: + nf_conntrack_helper_fini(); err_helper: nf_conntrack_timeout_fini(); err_timeout: @@ -1632,19 +1638,12 @@ int nf_conntrack_init_net(struct net *net) ret = nf_conntrack_helper_pernet_init(net); if (ret < 0) goto err_helper; - - ret = nf_conntrack_labels_init(net); - if (ret < 0) - goto err_labels; - ret = nf_conntrack_proto_init(net); if (ret < 0) goto err_proto; return 0; err_proto: - nf_conntrack_labels_fini(net); -err_labels: nf_conntrack_helper_pernet_fini(net); err_helper: nf_conntrack_ecache_pernet_fini(net); |