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

net: core: Fix build with CONFIG_IPV6=m

Stephen Rothwell reports the following link failure with IPv6 as module:

x86_64-linux-gnu-ld: net/core/filter.o: in function `sk_lookup':
(.text+0x19219): undefined reference to `__udp6_lib_lookup'

Fix the build by only enabling the IPv6 socket lookup if IPv6 support is
compiled into the kernel.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

authored by

Joe Stringer and committed by
Daniel Borkmann
d71019b5 33d9a7fd

+1 -1
+1 -1
net/core/filter.c
··· 4838 4838 sk = __udp4_lib_lookup(net, src4, tuple->ipv4.sport, 4839 4839 dst4, tuple->ipv4.dport, 4840 4840 dif, sdif, &udp_table, skb); 4841 - #if IS_ENABLED(CONFIG_IPV6) 4841 + #if IS_REACHABLE(CONFIG_IPV6) 4842 4842 } else { 4843 4843 struct in6_addr *src6 = (struct in6_addr *)&tuple->ipv6.saddr; 4844 4844 struct in6_addr *dst6 = (struct in6_addr *)&tuple->ipv6.daddr;