diff options
author | 2020-06-22 10:10:14 -0700 | |
---|---|---|
committer | 2020-06-25 00:50:31 +0200 | |
commit | 5f027bc74a9be2e53233de4ebcd2f90390b50a62 (patch) | |
tree | d29c9d9b0dcb451bc14369a529e045e0eeb1c606 /net/ipv6/netfilter/ip6table_raw.c | |
parent | netfilter: ip6tables: Split ip6t_unregister_table() into pre_exit and exit helpers. (diff) | |
download | linux-dev-5f027bc74a9be2e53233de4ebcd2f90390b50a62.tar.xz linux-dev-5f027bc74a9be2e53233de4ebcd2f90390b50a62.zip |
netfilter: ip6tables: Add a .pre_exit hook in all ip6table_foo.c.
Using new helpers ip6t_unregister_table_pre_exit() and
ip6t_unregister_table_exit().
Fixes: b9e69e127397 ("netfilter: xtables: don't hook tables by default")
Signed-off-by: David Wilder <dwilder@us.ibm.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv6/netfilter/ip6table_raw.c')
-rw-r--r-- | net/ipv6/netfilter/ip6table_raw.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c index a22100b1cf2c..8f9e742226f7 100644 --- a/net/ipv6/netfilter/ip6table_raw.c +++ b/net/ipv6/netfilter/ip6table_raw.c @@ -66,15 +66,23 @@ static int __net_init ip6table_raw_table_init(struct net *net) return ret; } +static void __net_exit ip6table_raw_net_pre_exit(struct net *net) +{ + if (net->ipv6.ip6table_raw) + ip6t_unregister_table_pre_exit(net, net->ipv6.ip6table_raw, + rawtable_ops); +} + static void __net_exit ip6table_raw_net_exit(struct net *net) { if (!net->ipv6.ip6table_raw) return; - ip6t_unregister_table(net, net->ipv6.ip6table_raw, rawtable_ops); + ip6t_unregister_table_exit(net, net->ipv6.ip6table_raw); net->ipv6.ip6table_raw = NULL; } static struct pernet_operations ip6table_raw_net_ops = { + .pre_exit = ip6table_raw_net_pre_exit, .exit = ip6table_raw_net_exit, }; |