diff options
author | David Wilder <dwilder@us.ibm.com> | 2020-06-22 10:10:12 -0700 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-06-25 00:50:31 +0200 |
commit | cf4cbc610bfa29a88cd71ca638a890f8c565a22e (patch) | |
tree | 907d25be1845827ba84e8d4a9e9176e5be13dc13 /net/ipv4/netfilter/iptable_raw.c | |
parent | netfilter: iptables: Split ipt_unregister_table() into pre_exit and exit helpers. (diff) | |
download | linux-dev-cf4cbc610bfa29a88cd71ca638a890f8c565a22e.tar.xz linux-dev-cf4cbc610bfa29a88cd71ca638a890f8c565a22e.zip |
netfilter: iptables: Add a .pre_exit hook in all iptable_foo.c.
Using new helpers ipt_unregister_table_pre_exit() and
ipt_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/ipv4/netfilter/iptable_raw.c')
-rw-r--r-- | net/ipv4/netfilter/iptable_raw.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c index 69697eb4bfc6..9abfe6bf2cb9 100644 --- a/net/ipv4/netfilter/iptable_raw.c +++ b/net/ipv4/netfilter/iptable_raw.c @@ -67,15 +67,23 @@ static int __net_init iptable_raw_table_init(struct net *net) return ret; } +static void __net_exit iptable_raw_net_pre_exit(struct net *net) +{ + if (net->ipv4.iptable_raw) + ipt_unregister_table_pre_exit(net, net->ipv4.iptable_raw, + rawtable_ops); +} + static void __net_exit iptable_raw_net_exit(struct net *net) { if (!net->ipv4.iptable_raw) return; - ipt_unregister_table(net, net->ipv4.iptable_raw, rawtable_ops); + ipt_unregister_table_exit(net, net->ipv4.iptable_raw); net->ipv4.iptable_raw = NULL; } static struct pernet_operations iptable_raw_net_ops = { + .pre_exit = iptable_raw_net_pre_exit, .exit = iptable_raw_net_exit, }; |