diff mbox series

[nf] netfilter: conntrack: unregister ipv4 sockopts on error unwind

Message ID 20210504144000.18155-1-fw@strlen.de
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nf] netfilter: conntrack: unregister ipv4 sockopts on error unwind | expand

Commit Message

Florian Westphal May 4, 2021, 2:40 p.m. UTC
When ipv6 sockopt register fails, the ipv4 one needs to be removed.

Fixes: a0ae2562c6c ("netfilter: conntrack: remove l3proto abstraction")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
The should be no confict/overlap with an existing sockopt range,
so I don't think the registration can fail in the first place.

However, its broken as-is.
An alternate solution (in -next), might be to change return type to void
and have nf_register_sockopt WARN() instead.

 net/netfilter/nf_conntrack_proto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
index 89e5bac384d7..dc9ca12b0489 100644
--- a/net/netfilter/nf_conntrack_proto.c
+++ b/net/netfilter/nf_conntrack_proto.c
@@ -664,7 +664,7 @@  int nf_conntrack_proto_init(void)
 
 #if IS_ENABLED(CONFIG_IPV6)
 cleanup_sockopt:
-	nf_unregister_sockopt(&so_getorigdst6);
+	nf_unregister_sockopt(&so_getorigdst);
 #endif
 	return ret;
 }