From owner-freebsd-pf@freebsd.org Wed Oct 14 19:20:26 2020 Return-Path: Delivered-To: freebsd-pf@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C017440A2F for ; Wed, 14 Oct 2020 19:20:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBMgt1JVbz4N8M; Wed, 14 Oct 2020 19:20:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id EB9E424419; Wed, 14 Oct 2020 19:20:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 814943B920; Wed, 14 Oct 2020 21:20:24 +0200 (CEST) From: "Kristof Provost" To: "J David" Cc: "Andreas Longwitz" , freebsd-pf@freebsd.org Subject: Re: Packets passed by pf don't make it out? Date: Wed, 14 Oct 2020 21:20:23 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: <66EA3FE1-598F-4D42-8464-5A3A5C75CD07@FreeBSD.org> In-Reply-To: References: <5F8336C7.5020709@incore.de> <5F84CF18.1040905@incore.de> <0072D8A9-6ACE-47D0-AE94-124C4F955735@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 19:20:26 -0000 On 14 Oct 2020, at 21:16, J David wrote: > On Wed, Oct 14, 2020 at 1:59 PM Kristof Provost > wrote: >> There’s good reason to do this, as we have to be able to match >> state >> on both the pre-translation side (when processing LAN -> WAN traffic) >> and post-translation (WAN -> LAN). > > So, basically, pf would need separate states for each pre-redirect > destination address in order to have the information needed to map the > reply packet back to the original destination address. > > But even if pf did that, the problem does not go away. It just moves > to the reply packet coming back with only the post-redirect info. > That info matches multiple states, leaving pf no way to pick the right > one. > > Is that about right? > Pretty much, I think. I’ve not dug very deep yet, but I wonder if we shouldn’t have to teach pf to change the source port to avoid conflicting states in the first place. It’s a non-trivial problem in any case. Regards, Kristof