Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_tables: NAT chain and extensions require NF_TABLES

Move these options inside the scope of the 'if' NF_TABLES and
NF_TABLES_IPV6 dependencies. This patch fixes:

net/ipv6/netfilter/nft_chain_nat_ipv6.o: In function `nft_nat_do_chain':
>> net/ipv6/netfilter/nft_chain_nat_ipv6.c:37: undefined reference to `nft_do_chain'
net/ipv6/netfilter/nft_chain_nat_ipv6.o: In function `nft_chain_nat_ipv6_exit':
>> net/ipv6/netfilter/nft_chain_nat_ipv6.c:94: undefined reference to `nft_unregister_chain_type'
net/ipv6/netfilter/nft_chain_nat_ipv6.o: In function `nft_chain_nat_ipv6_init':
>> net/ipv6/netfilter/nft_chain_nat_ipv6.c:87: undefined reference to `nft_register_chain_type'

that happens with:

CONFIG_NF_TABLES=m
CONFIG_NFT_CHAIN_NAT_IPV6=y

Fixes: 02c7b25e5f54 ("netfilter: nf_tables: build-in filter chain type")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

+28 -27
+28 -27
net/ipv6/netfilter/Kconfig
··· 48 48 fields such as the source, destination, flowlabel, hop-limit and 49 49 the packet mark. 50 50 51 + if NF_NAT_IPV6 52 + 53 + config NFT_CHAIN_NAT_IPV6 54 + tristate "IPv6 nf_tables nat chain support" 55 + help 56 + This option enables the "nat" chain for IPv6 in nf_tables. This 57 + chain type is used to perform Network Address Translation (NAT) 58 + packet transformations such as the source, destination address and 59 + source and destination ports. 60 + 61 + config NFT_MASQ_IPV6 62 + tristate "IPv6 masquerade support for nf_tables" 63 + depends on NFT_MASQ 64 + select NF_NAT_MASQUERADE_IPV6 65 + help 66 + This is the expression that provides IPv4 masquerading support for 67 + nf_tables. 68 + 69 + config NFT_REDIR_IPV6 70 + tristate "IPv6 redirect support for nf_tables" 71 + depends on NFT_REDIR 72 + select NF_NAT_REDIRECT 73 + help 74 + This is the expression that provides IPv4 redirect support for 75 + nf_tables. 76 + 77 + endif # NF_NAT_IPV6 78 + 51 79 config NFT_REJECT_IPV6 52 80 select NF_REJECT_IPV6 53 81 default NFT_REJECT ··· 135 107 136 108 if NF_NAT_IPV6 137 109 138 - config NFT_CHAIN_NAT_IPV6 139 - depends on NF_TABLES_IPV6 140 - tristate "IPv6 nf_tables nat chain support" 141 - help 142 - This option enables the "nat" chain for IPv6 in nf_tables. This 143 - chain type is used to perform Network Address Translation (NAT) 144 - packet transformations such as the source, destination address and 145 - source and destination ports. 146 - 147 110 config NF_NAT_MASQUERADE_IPV6 148 111 tristate "IPv6 masquerade support" 149 112 help 150 113 This is the kernel functionality to provide NAT in the masquerade 151 114 flavour (automatic source address selection) for IPv6. 152 - 153 - config NFT_MASQ_IPV6 154 - tristate "IPv6 masquerade support for nf_tables" 155 - depends on NF_TABLES_IPV6 156 - depends on NFT_MASQ 157 - select NF_NAT_MASQUERADE_IPV6 158 - help 159 - This is the expression that provides IPv4 masquerading support for 160 - nf_tables. 161 - 162 - config NFT_REDIR_IPV6 163 - tristate "IPv6 redirect support for nf_tables" 164 - depends on NF_TABLES_IPV6 165 - depends on NFT_REDIR 166 - select NF_NAT_REDIRECT 167 - help 168 - This is the expression that provides IPv4 redirect support for 169 - nf_tables. 170 115 171 116 endif # NF_NAT_IPV6 172 117