diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2012-05-28 17:04:10 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-06-07 08:58:39 -0400 |
commit | 524a53e5ad5f34f64ed34281e8b0eca19437db5b (patch) | |
tree | e6ad5ef71a1fe4b95c3ab5690d5e728513765e5d /net/ipv6 | |
parent | 2c352f444ccfa966a1aa4fd8e9ee29381c467448 (diff) |
netfilter: nf_conntrack: prepare namespace support for l3 protocol trackers
This patch prepares the namespace support for layer 3 protocol trackers.
Basically, this modifies the following interfaces:
* nf_ct_l3proto_[un]register_sysctl.
* nf_conntrack_l3proto_[un]register.
We add a new nf_ct_l3proto_net is used to get the pernet data of l3proto.
This adds rhe new struct nf_ip_net that is used to store the sysctl header
and l3proto_ipv4,l4proto_tcp(6),l4proto_udp(6),l4proto_icmp(v6) because the
protos such tcp and tcp6 use the same data,so making nf_ip_net as a field
of netns_ct is the easiest way to manager it.
This patch also adds init_net to struct nf_conntrack_l3proto to initial
the layer 3 protocol pernet data.
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c index 51ad9f104421..7334cbfd6003 100644 --- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | |||
@@ -358,7 +358,7 @@ static int __init nf_conntrack_l3proto_ipv6_init(void) | |||
358 | goto cleanup_udp; | 358 | goto cleanup_udp; |
359 | } | 359 | } |
360 | 360 | ||
361 | ret = nf_conntrack_l3proto_register(&nf_conntrack_l3proto_ipv6); | 361 | ret = nf_conntrack_l3proto_register(&init_net, &nf_conntrack_l3proto_ipv6); |
362 | if (ret < 0) { | 362 | if (ret < 0) { |
363 | pr_err("nf_conntrack_ipv6: can't register ipv6\n"); | 363 | pr_err("nf_conntrack_ipv6: can't register ipv6\n"); |
364 | goto cleanup_icmpv6; | 364 | goto cleanup_icmpv6; |
@@ -374,7 +374,7 @@ static int __init nf_conntrack_l3proto_ipv6_init(void) | |||
374 | return ret; | 374 | return ret; |
375 | 375 | ||
376 | cleanup_ipv6: | 376 | cleanup_ipv6: |
377 | nf_conntrack_l3proto_unregister(&nf_conntrack_l3proto_ipv6); | 377 | nf_conntrack_l3proto_unregister(&init_net, &nf_conntrack_l3proto_ipv6); |
378 | cleanup_icmpv6: | 378 | cleanup_icmpv6: |
379 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_icmpv6); | 379 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_icmpv6); |
380 | cleanup_udp: | 380 | cleanup_udp: |
@@ -388,7 +388,7 @@ static void __exit nf_conntrack_l3proto_ipv6_fini(void) | |||
388 | { | 388 | { |
389 | synchronize_net(); | 389 | synchronize_net(); |
390 | nf_unregister_hooks(ipv6_conntrack_ops, ARRAY_SIZE(ipv6_conntrack_ops)); | 390 | nf_unregister_hooks(ipv6_conntrack_ops, ARRAY_SIZE(ipv6_conntrack_ops)); |
391 | nf_conntrack_l3proto_unregister(&nf_conntrack_l3proto_ipv6); | 391 | nf_conntrack_l3proto_unregister(&init_net, &nf_conntrack_l3proto_ipv6); |
392 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_icmpv6); | 392 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_icmpv6); |
393 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_udp6); | 393 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_udp6); |
394 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_tcp6); | 394 | nf_conntrack_l4proto_unregister(&init_net, &nf_conntrack_l4proto_tcp6); |