From patchwork Tue Jun 25 00:12:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 167666 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4841434ilk; Mon, 24 Jun 2019 17:13:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5LEqHHcQ+zpfN6SWyhrwaXmk6WeMfhq0sa6Y9PubbMqgjW47e6sbffO+5+bAxSlWhMKEm X-Received: by 2002:a63:4419:: with SMTP id r25mr36920070pga.247.1561421586664; Mon, 24 Jun 2019 17:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561421586; cv=none; d=google.com; s=arc-20160816; b=Oatei7Ql4GakNDZzeF7esIhPfN/+HB98ShidRQKHHpDdIif2J07Wn5Ts/hXCjYiyrM huZiFu/lOHVS5+PDaSc1T7iym6oYqJPH6bsZ4qx2MJR01AI90ztbHvrcYPrlJx0k3LHC Sjozk+cBfr3eKyDJR5urnK+/dpAl3WO5+cdw1JKAYqCdSxrJ38JjQaveIEw0Sc/WSTDW T18EM0X1OtQr3hn8ZjdNjusfAbXkUR2G9NbPqCdWFv0sStDajSX0zsl7ZaY3m7PQC7wP 7/IE9qnDpCogQyNsLMyNturJayElPlR1QMWk3QzCDCtVRAGeUPZJAEoqQO3DcwPOt/Hj W6GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=XBnP4RrO3JdJdldh8HW625HeCSMS+LCnzu3W5/iz72U=; b=MOQIQrL88uZRVoYbdpJDPp2l87+vyfiixI6st2EnirW/k7DTt1v5qbq1Gr2GO9Pm6/ rUMjV54UM0XhZCh6nEDgpKFgrCrUR0TiaYTdQ/h7aldRi2srIH+K9xNm3jcEjaXohgsI hrkeuycJYE/vGTaZBHprVfu4QGfvGT2YMRH4z+F9UgIPVJsT01a7EKLh4XdOPajVcHq/ eQn8BLjanud2pRa8m9q+QGyEyHvHvR5k454sJt9GeIVXRoNjPjeYVuu2NXx4MtjDrw6F Bssu+0+cCE0CNMIYp/WPEoUvabL6n350didBahYsryvUSGtQqsgC/DmJ/6IZF+kHxrEh rQUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 k25si2446305pgb.36.2019.06.24.17.13.06; Mon, 24 Jun 2019 17:13:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729550AbfFYAM7 (ORCPT + 9 others); Mon, 24 Jun 2019 20:12:59 -0400 Received: from mail.us.es ([193.147.175.20]:38014 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729481AbfFYAM4 (ORCPT ); Mon, 24 Jun 2019 20:12:56 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id E5B42C04AC for ; Tue, 25 Jun 2019 02:12:54 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id D5F7ADA70B for ; Tue, 25 Jun 2019 02:12:54 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id CB82FDA708; Tue, 25 Jun 2019 02:12:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id C9151DA702; Tue, 25 Jun 2019 02:12:52 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Tue, 25 Jun 2019 02:12:52 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from salvia.here (sys.soleta.eu [212.170.55.40]) (Authenticated sender: pneira@us.es) by entrada.int (Postfix) with ESMTPA id A07744265A2F; Tue, 25 Jun 2019 02:12:52 +0200 (CEST) X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org Cc: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH 23/26] netfilter: fix nf_conntrack_bridge/ipv6 link error Date: Tue, 25 Jun 2019 02:12:30 +0200 Message-Id: <20190625001233.22057-24-pablo@netfilter.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190625001233.22057-1-pablo@netfilter.org> References: <20190625001233.22057-1-pablo@netfilter.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann 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 Signed-off-by: Pablo Neira Ayuso --- include/linux/netfilter_ipv6.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) -- 2.11.0 diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 22e6398bc482..7beb681e1ce5 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h @@ -75,8 +75,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 } @@ -113,8 +115,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 } @@ -138,8 +142,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 } @@ -154,8 +160,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 }