summaryrefslogtreecommitdiff
path: root/net/netfilter
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2022-02-10 10:06:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-23 11:59:57 +0100
commit73f8575216b114beeb66ee5d16495d962b8c9f51 (patch)
tree73d708ee73e20d5e0ca7650eb2d34abc264c2ca7 /net/netfilter
parent5e8c5b217cfb46066c6cac9d0d754054d1ef9199 (diff)
netfilter: nft_synproxy: unregister hooks on init error path
commit 2b4e5fb4d3776c391e40fb33673ba946dd96012d upstream. Disable the IPv4 hooks if the IPv6 hooks fail to be registered. Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nft_synproxy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/netfilter/nft_synproxy.c b/net/netfilter/nft_synproxy.c
index e2c1fc608841..15abb0e49603 100644
--- a/net/netfilter/nft_synproxy.c
+++ b/net/netfilter/nft_synproxy.c
@@ -191,8 +191,10 @@ static int nft_synproxy_do_init(const struct nft_ctx *ctx,
if (err)
goto nf_ct_failure;
err = nf_synproxy_ipv6_init(snet, ctx->net);
- if (err)
+ if (err) {
+ nf_synproxy_ipv4_fini(snet, ctx->net);
goto nf_ct_failure;
+ }
break;
}