From patchwork Mon Jul 9 21:35:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141492 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3119355ljj; Mon, 9 Jul 2018 14:36:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfA5ONBy9hcF858HPXYNlpbGnYQSPBuiDbsg2NqF1YuTJXgctgp8tCO8i3MhsbuBI6JbLRm X-Received: by 2002:a17:902:6b84:: with SMTP id p4-v6mr22053477plk.272.1531172164757; Mon, 09 Jul 2018 14:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531172164; cv=none; d=google.com; s=arc-20160816; b=xGNTh4bbhy4f3Bnd28ABHPXHpPnX9kD4uW49SV6L5EwRvgfyjKprlcLVofKszAbl1L mORC4uD+Dpptm5Y48j+27ieJfP1iQobKgob5jKmmBvQfPYa7gqYFtj0WvoMVLhdGFotJ pGVYBqpNzfm8H+/xYk2I6WgshP/5wDDSpLppkjG37WwKjJeqPkmfx/8N3VdFwVEQtD+K hdCc10qVbojipdbZSS24DAvvow18nkBo6D3AN/mEiY1LmpeOZiUA23RPdP8CXQO3JDIW zumDr6unIDzli0JEUelRhv6aGkRMpY6oZMXEmE/emjpOpJNMyyS4fhM3yO22+tarouS8 hN4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/d6INBo75/93qj+5QKEVgife4FwCVxWz29JVWLnPcqs=; b=Bti4kQHEDh66whOhNXQyJoERzoWwwZjX0uf4R230Ht2qJDJIeLcc245O1s3KHSQyAM 6asu4FjCqv8hkhY2OADTQODzkqV0cQLRoN9iVZQWMhLtFjlDxe+kQRrTtYlQAGE/cLA1 WdSkl9yzJ1ooW62DGPNS0asbPfWKMUysTaiEAPc9lQGo3l/qM5kAjtN7hcWLy/gHa0IW JWOQHxRl9pYlVlMKy83Ef7lBBtcfKaq7xakP4BEKvH2f23NFbYCYkligsbQ5sIpgInax zz+L9kwUZ6LiH7MV6OCJmKIUp+gBwTZXmny1XC0VyqnW3oaFv1bqC4OsYdb5Ui+LQBz4 ZgYA== 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 b2-v6si13143975pgc.541.2018.07.09.14.36.04; Mon, 09 Jul 2018 14:36:04 -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 S933446AbeGIVgD (ORCPT + 26 others); Mon, 9 Jul 2018 17:36:03 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:48841 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933060AbeGIVgB (ORCPT ); Mon, 9 Jul 2018 17:36:01 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LgGqC-1gQ0vR1ZsS-00nlbT; Mon, 09 Jul 2018 23:35:41 +0200 From: Arnd Bergmann To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal Cc: Arnd Bergmann , "David S. Miller" , =?utf-8?b?TcOhdMOpIEVja2w=?= , Flavio Leitner , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netfilter: NFT_SOCKET don't use NF_SOCKET_IPV6 without NF_TABLES_IPV6 Date: Mon, 9 Jul 2018 23:35:09 +0200 Message-Id: <20180709213537.2748896-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:EQnLo/RcaPkyTdZHLouXT0pY33lEG1+rT6qlW/G50yhH0N3q2YT p0I54FxVSBmJMuk8RFeree0wCKeIk3yTNkGYeS+2fFwc5E9fDe43jdAj78aZ1Rtir25+kVO PgjUP8v0ZQg8G8gE1NADQHr/3i4oaxWJtHWwe361aX3QUALn+dzgIrRhWHH3Bnf+ixmBVjK wnFOqoTyA8hDnvKOkQapw== X-UI-Out-Filterresults: notjunk:1; V01:K0:lBtSqEWjSnw=:M//ey0M6FvrjCLrsCkclLO OU3fuiJFkfYwivpmecVmqtHTMQwdch8FvNRCV1r7t4cRJbnPoWVmJX5B5PTpCxLjfyQhdui8Z SH3JkfmZh6D9N4YwOIK5JEQH0TXOO36iYkrb6WVj7DTPXFOSJJGrtgtuVq1XnBIgfAhC5QtLk MTJdh48CdGxEpItIL/FXy4KolHlAVAgJ5B1m9YpJMqNDusVkAcM/tTgV9nUItRQwGPKPafVuQ Yd60cmqklXxWQ0rPrgSqJsCw+k81i1sBXwy2hNseAvY0wy571zGmvDD7R0nihYqB7kA7Rc9yo f4rSXMkq9y3rhZBmf0Y4fTU1QwfsnnYpN2i7HfVuwkmE57FOJc6s7CsMgLi9/73xpOTlMLvL8 80zhFvoUATgA4CfptU3IC1pi8xilJknRk7F+Nkoq6eL6RiycFvciK//KYKlLc4I/bwh4Soyi0 uc1UrComr6w09WogtRW9il7Rc2c5kYMi5ls+uO00WDlHEMF1fG4E3eS8mNUEKALLolyZYYVCD Ecuhnwzj7chgs16GA4Yfptsgp/L+M39M4BL81/Y1PPGv987NQ2zbfp2FvA+snEvGi3nF3BDkc vXuStWhf4TzwV9WXAAGsoP7J2xwzx0hSGKA4s2A3gR6S4rmWDC24AoZFFjQ/JaQ8ajYqtid8p tktQ4LNasMUOjrg5IDsyjOoEORNRw+kPs6bD33L7UIWVYqx9BAdAy1yHp9/piIiTnCjc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is now possible to build the nft_socket module as built-in when NF_TABLES_IPV6 is disabled, and have NF_SOCKET_IPV6=m set manually. In this case, the NF_SOCKET_IPV6 functionality will be useless according to the explanation in commit 35bf1ccecaaa ("netfilter: Kconfig: Change IPv6 select dependencies"), but on top of that it also causes a link error: net/netfilter/nft_socket.o: In function `nft_socket_eval': nft_socket.c:(.text+0x162): undefined reference to `nf_sk_lookup_slow_v6' This changes the compile-time check so we don't attempt to use the NF_SOCKET_IPV6 code when it cannot be used, and make it all compile again. That may lead to unexpected behavior when a user enables NF_SOCKET_IPV6 but cannot use it, but seems to be the logical conclusion of the 35bf1ccecaaa change. Fixes: 35bf1ccecaaa ("netfilter: Kconfig: Change IPv6 select dependencies") Signed-off-by: Arnd Bergmann --- --- net/netfilter/nft_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/net/netfilter/nft_socket.c b/net/netfilter/nft_socket.c index 998c2b546f6d..e43c1939d25f 100644 --- a/net/netfilter/nft_socket.c +++ b/net/netfilter/nft_socket.c @@ -31,7 +31,7 @@ static void nft_socket_eval(const struct nft_expr *expr, case NFPROTO_IPV4: sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, nft_in(pkt)); break; -#if IS_ENABLED(CONFIG_NF_SOCKET_IPV6) +#if IS_ENABLED(CONFIG_NF_TABLES_IPV6) case NFPROTO_IPV6: sk = nf_sk_lookup_slow_v6(nft_net(pkt), skb, nft_in(pkt)); break; @@ -77,7 +77,7 @@ static int nft_socket_init(const struct nft_ctx *ctx, switch(ctx->family) { case NFPROTO_IPV4: -#if IS_ENABLED(CONFIG_NF_SOCKET_IPV6) +#if IS_ENABLED(CONFIG_NF_TABLES_IPV6) case NFPROTO_IPV6: #endif case NFPROTO_INET: