Skip to contentSkip to conversation

netfilter: Kconfig: make NF_FLOW_TABLE_INET depend on NF_TABLES_INET

PATCH In review Fernando Fernandez Mancera 2 participants 3 messages Mar 26 – Apr 10

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: Kconfig: make NF_FLOW_TABLE_INET depend on NF_TABLES_INET

As it is not possible to create an inet flowtable without a parent table on inet family, it makes sense that Kconfig NF_FLOW_TABLE_INET symbol depends on NF_TABLES_INET. This reduces the kernel image size a bit when compiling the kernel with CONFIG_IPV6=n.

---
 net/netfilter/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/Kconfig +1 -0
index 6cdc994fdc8a..c50f2ad67b51 100644
@@ -717,6 +717,7 @@ endif # NF_TABLES
 config NF_FLOW_TABLE_INET
 	tristate "Netfilter flow table mixed IPv4/IPv6 module"
 	depends on NF_FLOW_TABLE
+	depends on NF_TABLES_INET
 	help
 	  This option adds the flow table mixed IPv4/IPv6 support.
 
Signature · 1 line
2.53.0
#1 lore raw
Quoted 4 lines · Fernando Fernandez Mancera

As it is not possible to create an inet flowtable without a parent table on inet family, it makes sense that Kconfig NF_FLOW_TABLE_INET symbol depends on NF_TABLES_INET. This reduces the kernel image size a bit when compiling the kernel with CONFIG_IPV6=n.

The nf_flow_table_inet.c file also defines ipv4 and ipv6:

static struct nf_flowtable_type flowtable_ipv4 = {

        .family         = NFPROTO_IPV4,
        .init           = nf_flow_table_init,
        .setup          = nf_flow_table_offload_setup,
        .action         = nf_flow_rule_route_ipv4,
        .free           = nf_flow_table_free,
        .hook           = nf_flow_offload_ip_hook,
        .owner          = THIS_MODULE,

};

static struct nf_flowtable_type flowtable_ipv6 = {

        .family         = NFPROTO_IPV6,
        .init           = nf_flow_table_init,
        .setup          = nf_flow_table_offload_setup,
        .action         = nf_flow_rule_route_ipv6,
        .free           = nf_flow_table_free,
        .hook           = nf_flow_offload_ipv6_hook,
        .owner          = THIS_MODULE,

};

The file name is a bit misleading, someone decide to squash ipv4, ipv6 and _inet_ into the same file.

Quoted 20 lines
---
 net/netfilter/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/Kconfig +1 -0
index 6cdc994fdc8a..c50f2ad67b51 100644
@@ -717,6 +717,7 @@ endif # NF_TABLES
 config NF_FLOW_TABLE_INET
 	tristate "Netfilter flow table mixed IPv4/IPv6 module"
 	depends on NF_FLOW_TABLE
+	depends on NF_TABLES_INET
 	help
 	  This option adds the flow table mixed IPv4/IPv6 support.
 
Signature · 1 line
2.53.0
#2 lore raw
Quoted 26 lines · Pablo Neira Ayuso
Quoted 4 lines · Fernando Fernandez Mancera

As it is not possible to create an inet flowtable without a parent table on inet family, it makes sense that Kconfig NF_FLOW_TABLE_INET symbol depends on NF_TABLES_INET. This reduces the kernel image size a bit when compiling the kernel with CONFIG_IPV6=n.

The nf_flow_table_inet.c file also defines ipv4 and ipv6:

static struct nf_flowtable_type flowtable_ipv4 = {

         .family         = NFPROTO_IPV4,
         .init           = nf_flow_table_init,
         .setup          = nf_flow_table_offload_setup,
         .action         = nf_flow_rule_route_ipv4,
         .free           = nf_flow_table_free,
         .hook           = nf_flow_offload_ip_hook,
         .owner          = THIS_MODULE,

};

static struct nf_flowtable_type flowtable_ipv6 = {

         .family         = NFPROTO_IPV6,
         .init           = nf_flow_table_init,
         .setup          = nf_flow_table_offload_setup,
         .action         = nf_flow_rule_route_ipv6,
         .free           = nf_flow_table_free,
         .hook           = nf_flow_offload_ipv6_hook,
         .owner          = THIS_MODULE,
Quoted 5 lines

};

The file name is a bit misleading, someone decide to squash ipv4, ipv6 and _inet_ into the same file.

I see everything is squashed into the same file and indeed under the same Kconfig. Then we need to throw away this patch.

Yes, it is a bit misleading but given it is like this I do not see a benefit into splitting it now into NF_FLOW_TABLE_IPV4, NF_FLOW_TABLE_IPV6 and NF_FLOW_TABLE_INET variants.

Thanks Pablo for pointing this out!
Fernando.