Skip to content

Commit 74ec4d5

Browse files
arndbummakynes
authored andcommitted
netfilter: fix xt_TEE and xt_TPROXY dependencies
Kconfig is too smart for its own good: a Kconfig line that states select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES means that if IP6_NF_IPTABLES is set to 'm', then NF_DEFRAG_IPV6 will also be set to 'm', regardless of the state of the symbol from which it is selected. When the xt_TEE driver is built-in and nothing else forces NF_DEFRAG_IPV6 to be built-in, this causes a link-time error: net/built-in.o: In function `tee_tg6': net/netfilter/xt_TEE.c:46: undefined reference to `nf_dup_ipv6' This works around that behavior by changing the dependency to 'if IP6_NF_IPTABLES != n', which is interpreted as boolean expression rather than a tristate and causes the NF_DEFRAG_IPV6 symbol to be built-in as well. The bug only occurs once in thousands of 'randconfig' builds and does not really impact real users. From inspecting the other surrounding Kconfig symbols, I am guessing that NETFILTER_XT_TARGET_TPROXY and NETFILTER_XT_MATCH_SOCKET have the same issue. If not, this change should still be harmless. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent c872a2d commit 74ec4d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/netfilter/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ config NETFILTER_XT_TARGET_TEE
869869
depends on IPV6 || IPV6=n
870870
depends on !NF_CONNTRACK || NF_CONNTRACK
871871
select NF_DUP_IPV4
872-
select NF_DUP_IPV6 if IP6_NF_IPTABLES
872+
select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
873873
---help---
874874
This option adds a "TEE" target with which a packet can be cloned and
875875
this clone be rerouted to another nexthop.
@@ -882,7 +882,7 @@ config NETFILTER_XT_TARGET_TPROXY
882882
depends on IP6_NF_IPTABLES || IP6_NF_IPTABLES=n
883883
depends on IP_NF_MANGLE
884884
select NF_DEFRAG_IPV4
885-
select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES
885+
select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES != n
886886
help
887887
This option adds a `TPROXY' target, which is somewhat similar to
888888
REDIRECT. It can only be used in the mangle table and is useful
@@ -1375,7 +1375,7 @@ config NETFILTER_XT_MATCH_SOCKET
13751375
depends on IPV6 || IPV6=n
13761376
depends on IP6_NF_IPTABLES || IP6_NF_IPTABLES=n
13771377
select NF_DEFRAG_IPV4
1378-
select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES
1378+
select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES != n
13791379
help
13801380
This option adds a `socket' match, which can be used to match
13811381
packets for which a TCP or UDP socket lookup finds a valid socket.

0 commit comments

Comments
 (0)