Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp828370imm; Tue, 5 Jun 2018 05:14:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIw0fpgpI2paMkIEa28b4M+NBcOY3TXJcqhjDzKY3FE4SAvCbEVTTltsRVpM+BR1ptdcA4L X-Received: by 2002:a65:62cd:: with SMTP id m13-v6mr11551448pgv.207.1528200897873; Tue, 05 Jun 2018 05:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528200897; cv=none; d=google.com; s=arc-20160816; b=vUYITxL6qQuxyCBXD9gH53r7GXC5+lco7QH57ULNK+5a+8o39Y9fdWMssq7trjt8om 4qU06zeEnPG1HnGu01CHSrw6/TdsDHabqA9KiD436ZCrkEsOFqKMK+TlMQ9jHE/qoTt3 ltMOsCRWYFLXoXNLEndv4ljtrHR5WRtibGDzvhwLrwfNoYceQtKPJXmTaQ7CRgc3EQia x/iUqsZImM1xoG5kEfrnle2Twnfiuval//g/ag/YUtsnRYYEthe+BnWaU5cyTe/IpNqr E0pgekrI30rxQHLpU4B9slodGd7aPcWXP1s+9GP2FmTQbeirsbzBIE1K4ElmNtckFX09 jdvQ== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=5WIPm6e639MpNfz6bjCy5zllfWsp/Nq1jHYZIekELoQ=; b=rzo3lgPIGH2hVgP6o7kZmSNCsMk0HCccIDHkI/fwDzYNVd7pCTujwOknFIm/sE3CEU rZ+NIErl6M5Cf/9TrCkV+svDVUZ9kx4hdUlxhxja9P/i62oBtrDJDewi93fQh8/gGbkA jW6KM7yFGR8WHsklvFFpPfkeZMsrONKkDZ6NFUjXQmOnKIjSkOmhfnM02V5dJhE6qmVm kIzrKcENU4fYNyXkt6LYMKkVx4ZCsIuv2YX7MdI+cdwTjOW6KXZWCbzduAFzkSrlGsq6 oENlw1KFFDLZAo+2/KExFKB2kMTkMHdXnAEc91Tvn47z9S5OkEvmqWJOqKKOpvTQ20Wc etew== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si12201597pfg.199.2018.06.05.05.14.43; Tue, 05 Jun 2018 05:14:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbeFEMNy (ORCPT + 99 others); Tue, 5 Jun 2018 08:13:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751908AbeFEMNv (ORCPT ); Tue, 5 Jun 2018 08:13:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF9DB4075384; Tue, 5 Jun 2018 12:13:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.32.181.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB9CC20628A0; Tue, 5 Jun 2018 12:13:47 +0000 (UTC) Message-ID: Subject: Re: [PATCH] netfilter: provide udp*_lib_lookup for nf_tproxy From: Paolo Abeni To: Arnd Bergmann , Pablo Neira Ayuso , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI Cc: =?ISO-8859-1?Q?M=E1t=E9?= Eckl , Willem de Bruijn , Eric Dumazet , David Ahern , Martin KaFai Lau , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 05 Jun 2018 14:13:47 +0200 In-Reply-To: <20180605114056.1239571-1-arnd@arndb.de> References: <20180605114056.1239571-1-arnd@arndb.de> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 05 Jun 2018 12:13:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 05 Jun 2018 12:13:50 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pabeni@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-06-05 at 13:40 +0200, Arnd Bergmann wrote: > 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(-) > > 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) > { LGTM, Acked-by: Paolo Abeni Thanks, Paolo