diff options
author | Patrick McHardy <kaber@trash.net> | 2007-03-14 19:38:25 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:40 -0400 |
commit | ac5357ebac43e191003c2cd0722377dccfa01a84 (patch) | |
tree | a5a09bed344af07a68a95c2c4606a6c7eedc4748 /net/netfilter/nf_conntrack_core.c | |
parent | b19caa0ca071dce76b0e81e957e7eb7c03d72cf5 (diff) |
[NETFILTER]: nf_conntrack: remove ugly hack in l4proto registration
Remove ugly special-casing of nf_conntrack_l4proto_generic, all it
wants is its sysctl tables registered, so do that explicitly in an
init function and move the remaining protocol initialization and
cleanup code to nf_conntrack_proto.c as well.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nf_conntrack_core.c')
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 7694c51f125..9858bcb29aa 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -1152,14 +1152,7 @@ void nf_conntrack_cleanup(void) | |||
1152 | free_conntrack_hash(nf_conntrack_hash, nf_conntrack_vmalloc, | 1152 | free_conntrack_hash(nf_conntrack_hash, nf_conntrack_vmalloc, |
1153 | nf_conntrack_htable_size); | 1153 | nf_conntrack_htable_size); |
1154 | 1154 | ||
1155 | nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_generic); | 1155 | nf_conntrack_proto_fini(); |
1156 | |||
1157 | /* free l3proto protocol tables */ | ||
1158 | for (i = 0; i < PF_MAX; i++) | ||
1159 | if (nf_ct_protos[i]) { | ||
1160 | kfree(nf_ct_protos[i]); | ||
1161 | nf_ct_protos[i] = NULL; | ||
1162 | } | ||
1163 | } | 1156 | } |
1164 | 1157 | ||
1165 | static struct list_head *alloc_hashtable(int size, int *vmalloced) | 1158 | static struct list_head *alloc_hashtable(int size, int *vmalloced) |
@@ -1237,7 +1230,6 @@ module_param_call(hashsize, set_hashsize, param_get_uint, | |||
1237 | 1230 | ||
1238 | int __init nf_conntrack_init(void) | 1231 | int __init nf_conntrack_init(void) |
1239 | { | 1232 | { |
1240 | unsigned int i; | ||
1241 | int ret; | 1233 | int ret; |
1242 | 1234 | ||
1243 | /* Idea from tcp.c: use 1/16384 of memory. On i386: 32MB | 1235 | /* Idea from tcp.c: use 1/16384 of memory. On i386: 32MB |
@@ -1279,16 +1271,10 @@ int __init nf_conntrack_init(void) | |||
1279 | goto err_free_conntrack_slab; | 1271 | goto err_free_conntrack_slab; |
1280 | } | 1272 | } |
1281 | 1273 | ||
1282 | ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_generic); | 1274 | ret = nf_conntrack_proto_init(); |
1283 | if (ret < 0) | 1275 | if (ret < 0) |
1284 | goto out_free_expect_slab; | 1276 | goto out_free_expect_slab; |
1285 | 1277 | ||
1286 | /* Don't NEED lock here, but good form anyway. */ | ||
1287 | write_lock_bh(&nf_conntrack_lock); | ||
1288 | for (i = 0; i < AF_MAX; i++) | ||
1289 | nf_ct_l3protos[i] = &nf_conntrack_l3proto_generic; | ||
1290 | write_unlock_bh(&nf_conntrack_lock); | ||
1291 | |||
1292 | /* For use by REJECT target */ | 1278 | /* For use by REJECT target */ |
1293 | rcu_assign_pointer(ip_ct_attach, __nf_conntrack_attach); | 1279 | rcu_assign_pointer(ip_ct_attach, __nf_conntrack_attach); |
1294 | 1280 | ||