From patchwork Mon Jun 17 13:15:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 167031 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2852294ilk; Mon, 17 Jun 2019 06:15:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHjmtfSanEpGBvFvm68sHGieqLa37dgeuR+9UsddKs5mWC7G/wzCDySscPuy2Qb3RpYOoV X-Received: by 2002:a17:90a:3aed:: with SMTP id b100mr26374330pjc.63.1560777338556; Mon, 17 Jun 2019 06:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560777338; cv=none; d=google.com; s=arc-20160816; b=0S4nwvi2KN1k/55GcmSDDB3fjpHJ+uaMwqaCs6Jk99TmydiVl/lgUuTRhZqi+CovQI 0s+f9xvi6Y28g9EES3TPw2LhIabxUvTWHBDvYOM1Y/8KO6FSVMo15WvwXrZj2LNJY6Tw mrbtsrlyqMvei2yr0jzst1oufsXRhEhzMEsP5SvlNyskPNeBaS9MRMcUGgzW1DwA8vYK tc0Cka2vjgZnKt5jczq0Hcj6FldPs2zBxBoPhBghfrPkeM/6HDvAb/VHcHzwyxZtc0yq LaZSaGvLUuodZQ1SEj0HNEjeLK4hSpogkuD2/dxbWRETAdtnjPBGPA1Kj6sHm4z82PaV UiKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=oDjEtHMbPXbJV06GGraCf+mvwt5SnBIBBzvrqUgkWkg=; b=SlO+EsOZ+WbiILoLzgLL08aK6tICR5oRXLr+Pc8lV4cB0f3R0Rqji7r+4LB261QTYa wJg5VWVh4XxP/4B5C4CzIvqzMegPQ7lA1dGWdpPV6LTxhkkZ0Z4WyzXV+5DbBjAjjePP hmH+WMpLf3RGPdoh91TbS4RGzzDnSSbI+f39ttemUGQWMcM9YmjPlLFUIO/cfGp4VDX/ RbGgecDR8BS3TBOkMxn0cvE5ftOCPwucOkbq0Eki15Y3NreYEe1L08V+Ug5VpmSz9Xpf reiZCk4Jz/acauTeqCUS7C5ohucduHQL/jEkvl9bMcGzeXk2Cz5pU1sRRGBbaU7VB6EH EWyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si10070771pjc.42.2019.06.17.06.15.38; Mon, 17 Jun 2019 06:15:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbfFQNPg (ORCPT + 27 others); Mon, 17 Jun 2019 09:15:36 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53289 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbfFQNPg (ORCPT ); Mon, 17 Jun 2019 09:15:36 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MYcy3-1i6v383M4x-00VdwG; Mon, 17 Jun 2019 15:15:17 +0200 From: Arnd Bergmann To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal Cc: Arnd Bergmann , "David S. Miller" , wenxu , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] netfilter: fix nf_conntrack_bridge/ipv6 link error Date: Mon, 17 Jun 2019 15:15:04 +0200 Message-Id: <20190617131515.2334941-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:ffG0oEGFDr8AoakyTAVdhP3B7AKNLLG3JBgSsWHS4btNTkhoB1a nxW8SSPAesUa46zwzTQwKD7N5lcrt0rljJDuCGm2a/HV0XvlBRz5BfPy634OqmQDa38aH7G iojviMbZ8EQjarVdpdHhuKGvq0QcFxeiD1w2j9af4In6z8fqEfQ1dbDfkFZZJSRLOOgxtJ5 CUyZgQgCcRgMeZ9Xl53VA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:5G9iyEa0TYs=:2C1glk3K9ALdpIwcvXu/S8 4VTK8tqnpHtghO/u53o+qv+4cIDEcj6DZ53677TJSlo43+l4tDR1pw3BNwVOU7jd97GyMSWhS EecgllSIhHmrhfuMEED1R8EhLyNZz91+dHkbuMKQKHA0J5xV45PbiJIdFYmJZQXI7YdaidIdz CXenG6wOd4aXZpe+KBpStxmXib6mTBJcESMGVcz1LqiWobKkP+7UU99tw0q7a+44CDgcBjXZc tSsfiy/cysRrpiNZDaAFE2px39fR5YRECVinJKEldQyEUZXWq8ylD+O+UPtV6CzKFKD9f/CTk lezwZ1PWA0AUXBMkynDqNFrMiK5CIpmupY+9dGfgzbDE7z0zHX2+pKBluXVVSI6g17QfgxzW6 HR7oVoSBOSJn4Wn473iQMn6wn7+x+iS8NtoZfHJciyJ/i0LsICHv/aG2tdYpnRqR98y7bDhMP bU0tPlvD43qmIhiKONvNBRfsnpDItqZTjWwuoTvvIRXsm5z2J96KbsuKx1sZNlHIcTm6+ZHJ2 s31jiV0RRQCEVYdRsClLLkYPC4zt3DBUlnV1XZKLOSNLwn/NdUNx0VWsdUnQOtzuvY+UKem1M DDpekBNH+j0brexGCAAZGU8rkzafzkfY4XtkQQ8HNYxksuSopi2SCGhSrEhi4kEq/va9fG3tN Ia4ri3O3uVsvohA5/gSVMYPsdjNBeLLggbeCYh921ObSfHmB147DaOkDuHLNKoIXg9wl0/x4z 0Ll8sQfKPBgVqlta03hi50zZN1mG+6ZBrZeQJw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_IPV6 is disabled, the bridge netfilter code produces a link error: ERROR: "br_ip6_fragment" [net/bridge/netfilter/nf_conntrack_bridge.ko] undefined! ERROR: "nf_ct_frag6_gather" [net/bridge/netfilter/nf_conntrack_bridge.ko] undefined! The problem is that it assumes that whenever IPV6 is not a loadable module, we can call the functions direction. This is clearly not true when IPV6 is disabled. There are two other functions defined like this in linux/netfilter_ipv6.h, so change them all the same way. Fixes: 764dd163ac92 ("netfilter: nf_conntrack_bridge: add support for IPv6") Signed-off-by: Arnd Bergmann --- include/linux/netfilter_ipv6.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) -- 2.20.0 diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 3a3dc4b1f0e7..85d61db88b05 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h @@ -70,8 +70,10 @@ static inline int nf_ipv6_chk_addr(struct net *net, const struct in6_addr *addr, return 1; return v6_ops->chk_addr(net, addr, dev, strict); -#else +#elif IS_BUILTIN(CONFIG_IPV6) return ipv6_chk_addr(net, addr, dev, strict); +#else + return 1; #endif } @@ -108,8 +110,10 @@ static inline int nf_ipv6_br_defrag(struct net *net, struct sk_buff *skb, return 1; return v6_ops->br_defrag(net, skb, user); -#else +#elif IS_BUILTIN(CONFIG_IPV6) return nf_ct_frag6_gather(net, skb, user); +#else + return 1; #endif } @@ -133,8 +137,10 @@ static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk, return 1; return v6_ops->br_fragment(net, sk, skb, data, output); -#else +#elif IS_BUILTIN(CONFIG_IPV6) return br_ip6_fragment(net, sk, skb, data, output); +#else + return 1; #endif } @@ -149,8 +155,10 @@ static inline int nf_ip6_route_me_harder(struct net *net, struct sk_buff *skb) return -EHOSTUNREACH; return v6_ops->route_me_harder(net, skb); -#else +#elif IS_BUILTIN(CONFIG_IPV6) return ip6_route_me_harder(net, skb); +#else + return -EHOSTUNREACH; #endif }