From nobody Wed May 31 16:07:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QWZ0w0mq1z4XBpY; Wed, 31 May 2023 16:07:44 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QWZ0w089hz4TyL; Wed, 31 May 2023 16:07:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685549264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VP3c3kUBhJdigihScwsX2NcWxpq+EoztxebHsZcIHa8=; b=Z3xhjUZPWU3veo441AB439TIPPmnCfxE/+EzEl9/BYvmwPMBFydBq2wei0I7CjOQ/8LFIb l7t3YI5QbRLFUdaYcHxegc4nuX7kz5j2sf/5l+/5oI4nKUYQ7a3pNIoTxModvy5PK2xsmY Vb36lJS6osadnXG4bmatVVaHglSl39Qvt1qXMJodqPSr2CAGdcx9ciYnV6vbPzzRKw5ZRK SXMAtcQOxbgWiSpdBqNZeJcNrlCPWSGyhZdE9HnLtuTB6u2AFdi5tbr7h1U974eDWxEBY2 ajAA+S5jF6JFB+6RM209oAHonpGdu9JietCj6XYDc+bC6XRZRrO+qcEntAFQyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685549264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VP3c3kUBhJdigihScwsX2NcWxpq+EoztxebHsZcIHa8=; b=ZEGC9WTdJoIrWPkjoWW5pVkYNrHDEnTBgskqq3occ3LViYzBf6V/9+y0caUBxylCI1F3M1 y5rkKXxnkFc2oOQhXCTtr8GgBX0u4snxNJe2f7kZlveRnJcTDJjkZz1zInUwgb/ALAWSR9 1cK6BtcaVYvSM76VRVC1/TQHuPwUNQS8gk5HvOEfF0aEgc+n0MBjT5MfGJLj4jv4hyENnV xXJ+jrsUuViUeWLV3aEWLnL9xf8a9bslb0AmPXrfJD9LhpdHf7cJvT6KW+LhRaY8hipR7C oFqv+0UCLV4RjlStQP4GvtZW8nCxauOer5TLHdSGvhGhbVzP5wkC7eYRuS7FFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685549264; a=rsa-sha256; cv=none; b=knuy+BMLEaZjiRfpw2H/CJW6aIgfrjvST3C9ObbjrtQT1TQPXoC65JNRTiBQnAuN3/Cq+1 lUXH6WX/l1DjMd9d16+OBtTURwEVOFVc3EKsg6t5HrOJFKySTKcbHY5TG2ZSHV8jX5Y8oF qf865cS168fn1GsQN6DOnyB+1Y/NkZ8LWFtkrWpS5bjs6u32LRwPOOU4QkZt2/Eyb8ilEK rhFXHFImUhnp9RWzK3yWswR1Q0hN2NwWU8z7dpdklfuMD4/vZfJDGXzK03FLgbzVfJ2FGT nNXrTCrl56YoaHiAVjNlGLRiHg+feHzHSPLYlmNqIg+N2yyB26NWpSGSGHKj2A== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QWZ0v5dnNz1Bcf; Wed, 31 May 2023 16:07:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id EB63C4DDB5; Wed, 31 May 2023 18:07:40 +0200 (CEST) From: Kristof Provost To: Doug Rabson Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 5ab151574c8a - main - netinet*: Fix redirects for connections from localhost Date: Wed, 31 May 2023 18:07:39 +0200 X-Mailer: MailMate (1.14r5937) Message-ID: <8674E4D4-FA56-407B-A68D-C665FCB8868D@FreeBSD.org> In-Reply-To: <202305311011.34VABVwJ006123@gitrepo.freebsd.org> References: <202305311011.34VABVwJ006123@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On 31 May 2023, at 12:11, Doug Rabson wrote: > The branch main has been updated by dfr: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5ab151574c8a1824c6cd8ede= d28506cb983284bc > > commit 5ab151574c8a1824c6cd8eded28506cb983284bc > Author: Doug Rabson > AuthorDate: 2023-05-24 13:11:37 +0000 > Commit: Doug Rabson > CommitDate: 2023-05-31 10:11:05 +0000 > > netinet*: Fix redirects for connections from localhost > > Redirect rules use PFIL_IN and PFIL_OUT events to allow packet filt= er > rules to change the destination address and port for a connection. > Typically, the rule triggers on an input event when a packet is rec= eived > by a router and the destination address and/or port is changed to > implement the redirect. When a reply packet on this connection is o= utput > to the network, the rule triggers again, reversing the modification= =2E > > When the connection is initiated on the same host as the packet fil= ter, > it is initially output via lo0 which queues it for input processing= =2E > This causes an input event on the lo0 interface, allowing redirect > processing to rewrite the destination and create state for the > connection. However, when the reply is received, no corresponding o= utput > event is generated; instead, the packet is delivered to the higher = level > protocol (e.g. tcp or udp) without reversing the redirect, the repl= y is > not matched to the connection and the packet is dropped (for tcp, a= > connection reset is also sent). > > This commit fixes the problem by adding a second packet filter call= in > the input path. The second call happens right before the handoff to= > higher level processing and provides the missing output event to al= low > the redirect's reply processing to perform its rewrite. This extra > processing is disabled by default and can be enabled using pfilctl:= > > pfilctl link -o pf:default-out inet-local > pfilctl link -o pf:default-out6 inet6-local > > PR: 268717 > Reviewed-by: kp, melifaro > MFC-after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D40256 It looks like there=E2=80=99s some fallout from this in the dummynet test= s: https://ci.freebsd.org/view/Test/job/FreeBSD-main-amd64-test/23646/#showF= ailuresLink Those tests set up the new hook, and without those hooks (i.e. with this = patch reverted) the tests pass again. Best regards, Kristof