From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Stringer Subject: [PATCH bpf-next] net: core: Fix build with CONFIG_IPV6=m Date: Tue, 2 Oct 2018 22:32:26 -0700 Message-ID: <20181003053226.16196-1-joe@wand.net.nz> Cc: netdev@vger.kernel.org, ast@kernel.org To: daniel@iogearbox.net Return-path: Received: from mail-pl1-f194.google.com ([209.85.214.194]:45400 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbeJCMTW (ORCPT ); Wed, 3 Oct 2018 08:19:22 -0400 Received: by mail-pl1-f194.google.com with SMTP id y15-v6so2861618plr.12 for ; Tue, 02 Oct 2018 22:32:33 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/filter.c b/net/core/filter.c index 591c698bc517..30c6b2d3ef16 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4838,7 +4838,7 @@ struct sock *sk_lookup(struct net *net, struct bpf_sock_tuple *tuple, sk = __udp4_lib_lookup(net, src4, tuple->ipv4.sport, dst4, tuple->ipv4.dport, dif, sdif, &udp_table, skb); -#if IS_ENABLED(CONFIG_IPV6) +#if IS_REACHABLE(CONFIG_IPV6) } else { struct in6_addr *src6 = (struct in6_addr *)&tuple->ipv6.saddr; struct in6_addr *dst6 = (struct in6_addr *)&tuple->ipv6.daddr; -- 2.17.1