diff options
author | Alexey Dobriyan <adobriyan@sw.ru> | 2008-01-31 07:49:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-31 22:28:06 -0500 |
commit | 3cb609d57c20027a8b39fc60b79b930a89da82d4 (patch) | |
tree | f88a4d355b6612665a0ea89ac91a746c06e2c3cc /net/ipv6 | |
parent | 715cf35ac9291f31a4fea7d022695a64cac0af80 (diff) |
[NETFILTER]: x_tables: create per-netns /proc/net/*_tables_*
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index b91738ab9f4e..bf9bb6e55bb5 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -2238,11 +2238,26 @@ static struct xt_match icmp6_matchstruct __read_mostly = { | |||
2238 | .family = AF_INET6, | 2238 | .family = AF_INET6, |
2239 | }; | 2239 | }; |
2240 | 2240 | ||
2241 | static int __net_init ip6_tables_net_init(struct net *net) | ||
2242 | { | ||
2243 | return xt_proto_init(net, AF_INET6); | ||
2244 | } | ||
2245 | |||
2246 | static void __net_exit ip6_tables_net_exit(struct net *net) | ||
2247 | { | ||
2248 | xt_proto_fini(net, AF_INET6); | ||
2249 | } | ||
2250 | |||
2251 | static struct pernet_operations ip6_tables_net_ops = { | ||
2252 | .init = ip6_tables_net_init, | ||
2253 | .exit = ip6_tables_net_exit, | ||
2254 | }; | ||
2255 | |||
2241 | static int __init ip6_tables_init(void) | 2256 | static int __init ip6_tables_init(void) |
2242 | { | 2257 | { |
2243 | int ret; | 2258 | int ret; |
2244 | 2259 | ||
2245 | ret = xt_proto_init(AF_INET6); | 2260 | ret = register_pernet_subsys(&ip6_tables_net_ops); |
2246 | if (ret < 0) | 2261 | if (ret < 0) |
2247 | goto err1; | 2262 | goto err1; |
2248 | 2263 | ||
@@ -2272,7 +2287,7 @@ err4: | |||
2272 | err3: | 2287 | err3: |
2273 | xt_unregister_target(&ip6t_standard_target); | 2288 | xt_unregister_target(&ip6t_standard_target); |
2274 | err2: | 2289 | err2: |
2275 | xt_proto_fini(AF_INET6); | 2290 | unregister_pernet_subsys(&ip6_tables_net_ops); |
2276 | err1: | 2291 | err1: |
2277 | return ret; | 2292 | return ret; |
2278 | } | 2293 | } |
@@ -2284,7 +2299,8 @@ static void __exit ip6_tables_fini(void) | |||
2284 | xt_unregister_match(&icmp6_matchstruct); | 2299 | xt_unregister_match(&icmp6_matchstruct); |
2285 | xt_unregister_target(&ip6t_error_target); | 2300 | xt_unregister_target(&ip6t_error_target); |
2286 | xt_unregister_target(&ip6t_standard_target); | 2301 | xt_unregister_target(&ip6t_standard_target); |
2287 | xt_proto_fini(AF_INET6); | 2302 | |
2303 | unregister_pernet_subsys(&ip6_tables_net_ops); | ||
2288 | } | 2304 | } |
2289 | 2305 | ||
2290 | /* | 2306 | /* |