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 66397C54FCB for ; Thu, 23 Apr 2020 16:05:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DCB820776 for ; Thu, 23 Apr 2020 16:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729492AbgDWQFp (ORCPT ); Thu, 23 Apr 2020 12:05:45 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:41493 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729405AbgDWQFp (ORCPT ); Thu, 23 Apr 2020 12:05:45 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 8253E30002223; Thu, 23 Apr 2020 18:05:42 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 54B383D0764; Thu, 23 Apr 2020 18:05:42 +0200 (CEST) Date: Thu, 23 Apr 2020 18:05:42 +0200 From: Lukas Wunner To: Laura Garcia Cc: Pablo Neira Ayuso , Daniel Borkmann , 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 Subject: Re: [PATCH nf-next 3/3] netfilter: Introduce egress hook Message-ID: <20200423160542.d3f6yef4av2gqvur@wunner.de> References: <14ab7e5af20124a34a50426fd570da7d3b0369ce.1583927267.git.lukas@wunner.de> <20200313145526.ikovaalfuy7rnkdl@salvia> <1bd50836-33c4-da44-5771-654bfb0348cc@iogearbox.net> <20200315132836.cj36ape6rpw33iqb@salvia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 question is whether that's going to be sufficient because Daniel mentioned having an in-tree user as a prerequisite for accepting this feature, to which Pablo responded with NAT64/NAT46. I don't have intentions of implementing those, but maybe someone else has. Thanks, Lukas