Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp983123imm; Mon, 9 Jul 2018 14:37:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeAPhgGaUveLtTLMa4YRoWcXreEUwegnl4aIQ2+0VAflg6y86e8yKewUXG/+yaqL0iC/Sb1 X-Received: by 2002:a62:c8c2:: with SMTP id i63-v6mr23129731pfk.73.1531172244318; Mon, 09 Jul 2018 14:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531172244; cv=none; d=google.com; s=arc-20160816; b=DHWkBzrI1Kcx69qNepxvXV2VU//gkY7M2iYz0n3dOGHQPwselar+/FhSU5I/f3gP9c xhJZKOT3rqGIQqRP01MH6NE/4Osle+qqE3H1NFHDSBfBAOGxFDbNAZ6zLj6rSGOu564P 8MonVxNl9Se2B4KOxGNPeOF33bHdB+2S13qi7EeVgs+z13pNJ5v+lfprV1H9xlnASuJZ roBwZ+sjmLlNT4if7zcoZECzWmCwVpFJaXImwch3u0n241cMrLeYgLq4dEFf1gbuT+le nxCJCr6wbzsQYy9/tJfczy/VGALxfg6N+P4B0fQRhKuF2fppK1Ti6Gx6lbpWBLPQaFS5 F7nA== 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 i35-v6si15294237plg.209.2018.07.09.14.37.09; Mon, 09 Jul 2018 14:37:24 -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 S933438AbeGIVgC (ORCPT + 99 others); Mon, 9 Jul 2018 17:36:02 -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?q?M=C3=A1t=C3=A9=20Eckl?= , 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(-) 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: -- 2.9.0