Skip to contentSkip to conversation

netfilter: conntrack: unregister ipv4 sockopts on error unwind

PATCH New Florian Westphal 1 participant 1 message May 4, 2021

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: conntrack: unregister ipv4 sockopts on error unwind

When ipv6 sockopt register fails, the ipv4 one needs to be removed.

Fixes a0ae2562c6c ("netfilter: conntrack: remove l3proto abstraction")

---
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(-)
net/netfilter/nf_conntrack_proto.c +1 -1
index 89e5bac384d7..dc9ca12b0489 100644
@@ -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;
 }
Signature · 1 line
2.26.3