Skip to contentSkip to conversation

netfilter: xt_socket: missing ifdef CONFIG_IP6_NF_IPTABLES dependency

PATCH In review Pablo Neira Ayuso 3 participants 3 messages Feb 11, 2022 – Feb 12, 2022

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: xt_socket: missing ifdef CONFIG_IP6_NF_IPTABLES dependency

nf_defrag_ipv6_disable() requires CONFIG_IP6_NF_IPTABLES.

Fixes 75063c9294fb ("netfilter: xt_socket: fix a typo in socket_mt_destroy()")
---
 net/netfilter/xt_socket.c | 2 ++
 1 file changed, 2 insertions(+)
net/netfilter/xt_socket.c +2 -0
index 662e5eb1cc39..7013f55f05d1 100644
@@ -220,8 +220,10 @@ static void socket_mt_destroy(const struct xt_mtdtor_param *par)
 {
 	if (par->family == NFPROTO_IPV4)
 		nf_defrag_ipv4_disable(par->net);
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
 	else if (par->family == NFPROTO_IPV6)
 		nf_defrag_ipv6_disable(par->net);
+#endif
 }
 
 static struct xt_match socket_mt_reg[] __read_mostly = {
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Pablo Neira Ayuso
Quoted 13 lines · Pablo Neira Ayuso

nf_defrag_ipv6_disable() requires CONFIG_IP6_NF_IPTABLES.

Fixes 75063c9294fb ("netfilter: xt_socket: fix a typo in socket_mt_destroy()")
---
  net/netfilter/xt_socket.c | 2 ++
  1 file changed, 2 insertions(+)
net/netfilter/xt_socket.c +0 -0
index 662e5eb1cc39..7013f55f05d1 100644

net/netfilter/xt_socket.c static void socket_mt_destroy(const struct xt_mtdtor_param *par) · line 229

Quoted 10 lines
net/netfilter/xt_socket.c +2 -0
@@ -220,8 +220,10 @@ static void socket_mt_destroy(const struct xt_mtdtor_param *par)
  {
  	if (par->family == NFPROTO_IPV4)
  		nf_defrag_ipv4_disable(par->net);
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
  	else if (par->family == NFPROTO_IPV6)
  		nf_defrag_ipv6_disable(par->net);
+#endif
  }
 
  static struct xt_match socket_mt_reg[] __read_mostly = {

Thanks for the fix.