From owner-freebsd-net@freebsd.org Sat Aug 17 22:01:35 2019 Return-Path: Delivered-To: freebsd-net@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 4403BB339B for ; Sat, 17 Aug 2019 22:01:35 +0000 (UTC) (envelope-from SRS0=eCLY=WN=vega.codepro.be=kp@codepro.be) Received: from mercury.codepro.be (mercury.codepro.be [IPv6:2001:4b98:dc0:41:216:3eff:fe31:eda8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits)) (Client CN "monitoring.codepro.be", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 469vKV04Gxz3LKF for ; Sat, 17 Aug 2019 22:01:33 +0000 (UTC) (envelope-from SRS0=eCLY=WN=vega.codepro.be=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) by mercury.codepro.be (Postfix) with ESMTPS id 579F090735; Sat, 17 Aug 2019 21:51:39 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id C98E821914; Sat, 17 Aug 2019 23:51:51 +0200 (CEST) Received: by vega.codepro.be (Postfix, from userid 1001) id BD92919659; Sat, 17 Aug 2019 23:51:51 +0200 (CEST) Date: Sat, 17 Aug 2019 23:51:51 +0200 From: Kristof Provost To: Andrew White Cc: freebsd-net@freebsd.org Subject: Re: pf (rules and nat) + (ipfw + dummynet) Message-ID: <20190817215151.GA8888@vega.codepro.be> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Checked-By-NSA: Probably User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 469vKV04Gxz3LKF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of SRS0=eCLY=WN=vega.codepro.be=kp@codepro.be designates 2001:4b98:dc0:41:216:3eff:fe31:eda8 as permitted sender) smtp.mailfrom=SRS0=eCLY=WN=vega.codepro.be=kp@codepro.be X-Spamd-Result: default: False [-2.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:4b98:dc0:41:216:3eff:fe31:eda8]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.79)[-0.788,0]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-0.19)[asn: 29169(-0.96), country: FR(-0.01)]; FORGED_SENDER(0.30)[kp@freebsd.org,SRS0=eCLY=WN=vega.codepro.be=kp@codepro.be]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29169, ipnet:2001:4b98::/32, country:FR]; FROM_NEQ_ENVFROM(0.00)[kp@freebsd.org, SRS0=eCLY=WN=vega.codepro.be=kp@codepro.be] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Aug 2019 22:01:35 -0000 On 2019-08-17 22:25:44 (+0100), Andrew White wrote: > Using 11.3 , I've been trying to configure pf with dummynet. Having ipfw > reply traffic sent into a dummynet pipe causes pf to reject the traffic. > > Searching around and looking at ip_input.c it looks like dummynet reinjects > the packet back into input and this is what causes the problem , I'm > guessing the checksum changes. > I would expect both firewalls to leave the packets with correct checksums, but I have to add the disclaimer that I do not consider mixing firewalls to be a supported use case. I can think of several things (IPv6 fragment handling, route-to at least) where combining pf with another firewall is very likely to break. > Is this a known behaviour and are there functioning patches ? I see > projects like opnsense and pfsense have patches for ip_input.c to skip some > of the code if it's a reinjected packet from dummynet > > I also see some work underway to separate dummynet from ipfw, is there any > docs for the goals or timelines, will this allow dummynet anchors and use > of dnctl to use pf with dummynet like in macos ? > This work was started by a prospective gsoc student, but they were not selected, and I have not seen any big patches come out of it. It's not on my own todo list. Regards, Kristof