net: Convert ip6 tables pernet_operations
authorKirill Tkhai <ktkhai@virtuozzo.com>
Wed, 7 Mar 2018 09:39:06 +0000 (12:39 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Mar 2018 17:36:43 +0000 (12:36 -0500)
The pernet_operations:

    ip6table_filter_net_ops
    ip6table_mangle_net_ops
    ip6table_nat_net_ops
    ip6table_raw_net_ops
    ip6table_security_net_ops

have exit methods, which call ip6t_unregister_table().
ip6table_filter_net_ops has init method registering
filter table.

Since there must not be in-flight ipv6 packets at the time
of pernet_operations execution and since pernet_operations
don't send ipv6 packets each other, these pernet_operations
are safe to be async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/netfilter/ip6table_filter.c
net/ipv6/netfilter/ip6table_mangle.c
net/ipv6/netfilter/ip6table_nat.c
net/ipv6/netfilter/ip6table_raw.c
net/ipv6/netfilter/ip6table_security.c

index 1343077dde938f29cb6262937c8587d2ed640b69..06561c84c0bc0012f669743e01352a745c3c87a6 100644 (file)
@@ -87,6 +87,7 @@ static void __net_exit ip6table_filter_net_exit(struct net *net)
 static struct pernet_operations ip6table_filter_net_ops = {
        .init = ip6table_filter_net_init,
        .exit = ip6table_filter_net_exit,
+       .async = true,
 };
 
 static int __init ip6table_filter_init(void)
index b0524b18c4fb3b64f941ea2531c3e0ccba800ba7..a11e25936b451bfbed1b0daf8d9020a95e7f4fcd 100644 (file)
@@ -107,6 +107,7 @@ static void __net_exit ip6table_mangle_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_mangle_net_ops = {
        .exit = ip6table_mangle_net_exit,
+       .async = true,
 };
 
 static int __init ip6table_mangle_init(void)
index 47306e45a80abf5225aab9c1209258302c63c161..4475fd300bb60f24608beda688c53fcc5e010c0f 100644 (file)
@@ -131,6 +131,7 @@ static void __net_exit ip6table_nat_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_nat_net_ops = {
        .exit   = ip6table_nat_net_exit,
+       .async  = true,
 };
 
 static int __init ip6table_nat_init(void)
index 710fa0806c37cddffae7cc56692a24ad9aa9d504..a88f3b1995b186ad90687d793c7be7c91dabd2dc 100644 (file)
@@ -75,6 +75,7 @@ static void __net_exit ip6table_raw_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_raw_net_ops = {
        .exit = ip6table_raw_net_exit,
+       .async = true,
 };
 
 static int __init ip6table_raw_init(void)
index cf26ccb04056e1346f40a1d34ff44e2b8eb9f518..320048c008dc40d9aa0791f042e8335ec550d8ed 100644 (file)
@@ -74,6 +74,7 @@ static void __net_exit ip6table_security_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_security_net_ops = {
        .exit = ip6table_security_net_exit,
+       .async = true,
 };
 
 static int __init ip6table_security_init(void)