From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7988DC83000 for ; Tue, 28 Apr 2020 20:11:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BC1E20B80 for ; Tue, 28 Apr 2020 20:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726363AbgD1ULe (ORCPT ); Tue, 28 Apr 2020 16:11:34 -0400 Received: from www62.your-server.de ([213.133.104.62]:42914 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbgD1ULd (ORCPT ); Tue, 28 Apr 2020 16:11:33 -0400 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1jTWZd-0005iy-An; Tue, 28 Apr 2020 22:11:21 +0200 Received: from [178.195.186.98] (helo=pc-9.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTWZc-000TWD-TC; Tue, 28 Apr 2020 22:11:20 +0200 Subject: Re: [PATCH nf-next 3/3] netfilter: Introduce egress hook To: Lukas Wunner , Laura Garcia Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Netfilter Development Mailing list , coreteam@netfilter.org, netdev@vger.kernel.org, Martin Mares , Dmitry Safonov <0x7f454c46@gmail.com>, Thomas Graf , Alexei Starovoitov , David Miller References: <14ab7e5af20124a34a50426fd570da7d3b0369ce.1583927267.git.lukas@wunner.de> <20200313145526.ikovaalfuy7rnkdl@salvia> <1bd50836-33c4-da44-5771-654bfb0348cc@iogearbox.net> <20200315132836.cj36ape6rpw33iqb@salvia> <20200423160542.d3f6yef4av2gqvur@wunner.de> From: Daniel Borkmann Message-ID: <1a27351b-78a8-febc-45d7-6ee2e8ebda9e@iogearbox.net> Date: Tue, 28 Apr 2020 22:11:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20200423160542.d3f6yef4av2gqvur@wunner.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.2/25796/Tue Apr 28 14:00:48 2020) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hey Lukas, On 4/23/20 6:05 PM, Lukas Wunner wrote: > On Thu, Apr 23, 2020 at 04:44:44PM +0200, Laura Garcia wrote: >> On Sun, Mar 15, 2020 at 2:29 PM Pablo Neira Ayuso wrote: >>> On Sat, Mar 14, 2020 at 01:12:02AM +0100, Daniel Borkmann wrote: >>>> On 3/13/20 3:55 PM, Pablo Neira Ayuso wrote: >>>>> We have plans to support for NAT64 and NAT46, this is the right spot >>>>> to do this mangling. There is already support for the tunneling >>>> >>>> But why is existing local-out or post-routing hook _not_ sufficient for >>>> NAT64 given it being IP based? >>> >>> Those hooks are not coming at the end of the IP processing. There is >>> very relevant IP code after those hooks that cannot be bypassed such >>> as fragmentation, tunneling and neighbour output. Such transformation >>> needs to happen after the IP processing, exactly from where Lukas is >>> proposing. >>> >>> [...] >>>>> infrastructure in netfilter from ingress, this spot from egress will >>>>> allow us to perform the tunneling from here. There is also no way to >>>>> drop traffic generated by dhclient, this also allow for filtering such >>>>> locally generated traffic. And many more. >> >> Any chance to continue with this approach? I'm afraid outbound >> af_packets also could not be filtered without this hook. > > Thanks Laura, good to hear there's interest in the functionality. > > Daniel submitted a revert of this series but didn't cc me: > > https://lore.kernel.org/netdev/bbdee6355234e730ef686f9321bd072bcf4bb232.1584523237.git.daniel@iogearbox.net/ > > In the ensuing discussion it turned out that the performance argument > may be addressed by a rearrangement of sch_handle_egress() and > nf_egress() invocations. I could look into amending the series > accordingly and resubmitting, though I'm currently swamped with > other work. The rework of these hooks is still on my todo list, too swamped with other stuff as well right now, but I'll see to have a prototype this net-next development cycle. Thanks, Daniel