diff options
author | Florian Westphal <fw@strlen.de> | 2021-04-21 09:51:04 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-04-26 03:20:46 +0200 |
commit | 4d705399191c3cfe1264588b3a4a8115e6c3b161 (patch) | |
tree | 8f8703df0d93dfbb6ad9f5b396082a09a24c7396 /net/ipv4/netfilter/arp_tables.c | |
parent | 6c0717545f2ca61c95f5f739da845e77cc8bd498 (diff) | |
download | linux-4d705399191c3cfe1264588b3a4a8115e6c3b161.tar.gz linux-4d705399191c3cfe1264588b3a4a8115e6c3b161.tar.bz2 linux-4d705399191c3cfe1264588b3a4a8115e6c3b161.zip |
netfilter: arptables: unregister the tables by name
and again, this time for arptables.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4/netfilter/arp_tables.c')
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index d6d45d820d79..8a16b0dc5271 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -1541,16 +1541,22 @@ out_free: return ret; } -void arpt_unregister_table_pre_exit(struct net *net, struct xt_table *table, +void arpt_unregister_table_pre_exit(struct net *net, const char *name, const struct nf_hook_ops *ops) { - nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); + struct xt_table *table = xt_find_table(net, NFPROTO_ARP, name); + + if (table) + nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); } EXPORT_SYMBOL(arpt_unregister_table_pre_exit); -void arpt_unregister_table(struct net *net, struct xt_table *table) +void arpt_unregister_table(struct net *net, const char *name) { - __arpt_unregister_table(net, table); + struct xt_table *table = xt_find_table(net, NFPROTO_ARP, name); + + if (table) + __arpt_unregister_table(net, table); } /* The built-in targets: standard (NULL) and error. */ |