From patchwork Tue Jun 5 11:40:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 137709 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp848423lji; Tue, 5 Jun 2018 04:41:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLFuKriOarNBOaSnDtyZYZY/NLqHEgjOSrfUTyTJt1/2MFbF9KG41R6SsB0HA5QYDzzORnN X-Received: by 2002:a65:5306:: with SMTP id m6-v6mr8127076pgq.250.1528198884710; Tue, 05 Jun 2018 04:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528198884; cv=none; d=google.com; s=arc-20160816; b=vWOuR5cBpPVNeN11GoE02CFQ5Yg3Mob4F3K5UG+MGGpoBytnUBO4ntDFB4TDp7yfuP vTzPNSXF/DG0nunoazmf75pW8gJ+hM+m5uA+CFFrzbY4jE5elFI5Cy/U3CT4WBvN7wku yetXxrcBKMyWBDBPJF/RJHuHDqzlRzxNgwZPB/G2c/Li5F9dEqEF7bZTgPBxXT8DLuzt sffaHnZ8z8JV5sVXHk9/+l3cBLCTYqKpn38kAWfyyMftYVgHn2mhoTemup4CXQLvhQ22 LBgloQiEKAte91P3UNCPYdR9hog8A9pKsT+S6X4yZeICBoR1rPPWaRNlbUvZN8q5fNON 1IJg== 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=//y8wMUO/i0Z0J9JPnIP54Vulai8RoActDSrLyAR0wg=; b=EqsQm01YlFoA9wmtX8E+8YGfOZ6Aj0v8RXFX9/5LR6qGczsMAzTa+GDhuKuqznHjnQ 5FGRlRWht79h+nh5H94zOfhMxdsiLShm92EL+xDvkBX/YaaSiy6E/o9DGwAEVlbmuPLb GaNL5AigzkDNrAmgcaj2rxHgm02CURBj5/6d3YZMyOt0nNJs0CPjruWdFQvUH2S2p0fs Z2cmLAkupmsVY9R4u/X7N9mb8V0+sdecMeNYzgFB6/XY9owplo2/X9+lKT0Iv4nGWzW6 8uNYGMVrkppzueSKv5RuBLigjPOvckhHUjMuMrONQOTv68zqrKYEtm3BeAKPyqFnI0ZO Z2lQ== 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 n12-v6si40396579pgs.560.2018.06.05.04.41.24; Tue, 05 Jun 2018 04:41: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 S1751792AbeFELlW (ORCPT + 30 others); Tue, 5 Jun 2018 07:41:22 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:36225 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644AbeFELlU (ORCPT ); Tue, 5 Jun 2018 07:41:20 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MVM1m-1fmb0j44VC-00Yfg2; Tue, 05 Jun 2018 13:41:04 +0200 From: Arnd Bergmann To: Pablo Neira Ayuso , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI Cc: =?utf-8?b?TcOhdMOpIEVja2w=?= , Arnd Bergmann , Paolo Abeni , Willem de Bruijn , Eric Dumazet , David Ahern , Martin KaFai Lau , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netfilter: provide udp*_lib_lookup for nf_tproxy Date: Tue, 5 Jun 2018 13:40:34 +0200 Message-Id: <20180605114056.1239571-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:wYkpbO36jcC5A4WjzmMP9ax+aFAXTqmEryXoaUE8v855ScIsXaI SD2me0ADicawpT0vfjCl0Yi711ekZ69d/voZqW0rhSUjyhSQBo/pO2OQDaOgqMCq9hxw7vi N4Ek5nuXl/0Ijs7IS7z98Vurm6OpSxVLtFXeXM+T4vpGDtsUvc2Xlq31Ccq4nASVre2qP6X VaudNr0cm52fayeCDigew== X-UI-Out-Filterresults: notjunk:1; V01:K0:B+qjXnKI+lE=:BBYuU06P97XgNzKq7TIrTw M6/XPLAntVIV+NJWyvACbD04cab0C7Hnzxi+T27OCCFagjLjfv/0nrrOVVlkmQg/JkrpCaTty GC9lPBFHs7rk0jJfYy6a7sXGM8iD2KJag0MA28py0nLWpamJZrYp1pe/fTAsREIOMlpk7RsWj qCoSfxRVhMaIeG/THpfz15XE3Pe817eSKd1NfxDCsqmMOEFKwFvb0tphwy7kF0gmC3u2oRZ1E s0LEjpitQ1RaTGJb2W+PeTFrPEUDQLEVSV8XVt7M0MER3bbCdxGpoS5ZWidBLMMMvGda0yz3K xICup0VgAS6hjfq9z7P9T+meLWkE9NdrR9j5zh0Bmptqje1f/kdI/GGjhFw02ViFF0dNiYmkc zlGiAIyCpf1PjLgtgsGaIlViuuIjChgJDK+JiRwKaAESph1betUU5oEdMecc/sRZIYuz4n31d q2AXlEWQuxPtGL8bxLUxH+VkPrRI6GWGxYiCovjpDfiMzLD1vFJuKvE8GWGcrJi2AHBCAn1QT 6GcEHGJLKYjxWDzuGhIf5/1lwLfeLQMjDwlUewERZlD64KleyXNglu4Oy4d15Rr9CyBYT60WS Gwc0DJYjcXe/9n1Aa1IXkEEphMs8PQ63wQtHVJ1Qqymfp0rf9mt/kcsvlip67JtmPAovvoGgS T2oshrkpLj52SBmFUA2k00zsnF1HPWLg9Ads/q6rWmtCMOyHqxfBR/zfT1mjx3NVwq+s= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is now possible to enable the libified nf_tproxy modules without also enabling NETFILTER_XT_TARGET_TPROXY, which throws off the ifdef logic in the udp core code: net/ipv6/netfilter/nf_tproxy_ipv6.o: In function `nf_tproxy_get_sock_v6': nf_tproxy_ipv6.c:(.text+0x1a8): undefined reference to `udp6_lib_lookup' net/ipv4/netfilter/nf_tproxy_ipv4.o: In function `nf_tproxy_get_sock_v4': nf_tproxy_ipv4.c:(.text+0x3d0): undefined reference to `udp4_lib_lookup' We can actually simplify the conditions now to provide the two functions exactly when they are needed. Fixes: 45ca4e0cf273 ("netfilter: Libify xt_TPROXY") Signed-off-by: Arnd Bergmann --- net/ipv4/udp.c | 4 +--- net/ipv6/udp.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) -- 2.9.0 Acked-by: Paolo Abeni Acked-by: Máté Eckl diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 4f16e5d71875..3365362cac88 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -544,9 +544,7 @@ EXPORT_SYMBOL_GPL(udp4_lib_lookup_skb); /* Must be called under rcu_read_lock(). * Does increment socket refcount. */ -#if IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_SOCKET) || \ - IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY) || \ - IS_ENABLED(CONFIG_NF_SOCKET_IPV4) +#if IS_ENABLED(CONFIG_NF_TPROXY_IPV4) || IS_ENABLED(CONFIG_NF_SOCKET_IPV4) struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, __be32 daddr, __be16 dport, int dif) { diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 967acff95bbe..164afd31aebf 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -285,9 +285,7 @@ EXPORT_SYMBOL_GPL(udp6_lib_lookup_skb); /* Must be called under rcu_read_lock(). * Does increment socket refcount. */ -#if IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_SOCKET) || \ - IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY) || \ - IS_ENABLED(CONFIG_NF_SOCKET_IPV6) +#if IS_ENABLED(CONFIG_NF_TPROXY_IPV6) || IS_ENABLED(CONFIG_NF_SOCKET_IPV6) struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, __be16 dport, int dif) {