From nobody Wed Jun 12 21:33:43 2024 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 4VzzLb39xLz5NTr0; Wed, 12 Jun 2024 21:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VzzLb2fCvz4L4l; Wed, 12 Jun 2024 21:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718228023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fke0ydwoRpnNgIkCFYykOxf2ywKRSGXfpJ2+Dxv6cKU=; b=Lm4ZlPhHONV7BeN0s22VYKHaYw8Wwojurvb6Ik+r8IvG7w7NCXS+qjouKHMqXVxZ+ysi1T 7rWodLTuh1d6NJo2Ii6oMJDAInUAFTchmewrD+0UhafmGkdzdg9M6dVy7RaYqGDarsA3Bq l2i2XzvTjDHljCGUG/CyMRXWBDDWAkMkTwqmJZaFN5jcgvKYQbyZf6SloUdTCfY0oHka1u a/jWRyf0nII1fpbtBvPodt8FkN0eWzcJhGMU+CO1XXhlcbbkeL2XC8xxEf+dBG+pO9JSUT vZQlMcbesnHLjSZDUBnn1eeGRuj1CGg80iPN0tmyR6YjVvtFSQl3Orxh+rXYrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718228023; a=rsa-sha256; cv=none; b=pALV1EyZvRH0g4DsnrX7et4RUlw7gJQS3r9jbgCSAcUDA20Wt+2zytmmb/mON4VHyfkzXc w6doKuyuqbyDNbSBhzztsIxZQj2jhCukjqLhI/JXlHeJgHmpnqE0QulpAjq0lWD64xJYIG tqixybQ+I0BiyB2Ed00EBoeQAZW6kj5P+pX5sNwGuS7ZFZHpyQueKTBilLVUIJy4XQTmvo Ku5zM89wczcks13keSlJOfVJLOC3WAg5qB28pHB4d1vIHwY/IbaotNF6QR6TOk3Gtmb9KW 2uyXjUueat31lN8RRRlpDX/tmkOeYgHLwgKqP5AXd3mPAb8ItSGHpNxGLR7mfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718228023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fke0ydwoRpnNgIkCFYykOxf2ywKRSGXfpJ2+Dxv6cKU=; b=g62XOrUYxP3M8ag0prJ1aGc1uh53dUM+YxazZ7rH0pjPk6INCw45VYHqMNAGpTNHV5xJyC doRhZvU8Xk7YhM206JlBl4RkpZHJCGfhUx6aN1vyW1fRzB4WFJ9dITzsIKalLNueK4AesP gB2pcDDuPxqpXMKWsk7Glm/i4HG4l5LhUWi83hSEkG3P6sDBaPrm6KeEYY1BbrwwzM+Q6q nad/dM6fMjBaxW5TN50VThqd3PofP+a723SPe7WlvH5hzoZ72+W2UxhUhzz0PQ28uhaAKc 1XpHWmbOZ8pyQpikcLjBwICj/l4aYp8SvFa0qZi+nYPWVicjLLQywLlUJVlqdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VzzLb2FwDz18dT; Wed, 12 Jun 2024 21:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45CLXh7l040868; Wed, 12 Jun 2024 21:33:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CLXhgi040865; Wed, 12 Jun 2024 21:33:43 GMT (envelope-from git) Date: Wed, 12 Jun 2024 21:33:43 GMT Message-Id: <202406122133.45CLXhgi040865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 20a2fe68faac - main - pf: correctly reset max_win if the SYN-ACK lacks a wscale option. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20a2fe68faacb98b3c87ce7ea46a16b0d6c2462b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=20a2fe68faacb98b3c87ce7ea46a16b0d6c2462b commit 20a2fe68faacb98b3c87ce7ea46a16b0d6c2462b Author: Kristof Provost AuthorDate: 2024-06-12 18:01:58 +0000 Commit: Kristof Provost CommitDate: 2024-06-12 21:33:11 +0000 pf: correctly reset max_win if the SYN-ACK lacks a wscale option. pf was setting max_win to 0 and discarded retransmitted SYN-ACK segments without wscale if the original SYN contained a wscale option. with gerhard@, ok henning@ Obtained From: OpenBSD Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 8c97d1bf200d..c635251c3490 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5315,8 +5315,9 @@ pf_tcp_track_full(struct pf_kstate **state, struct pfi_kkif *kif, dws = dst->wscale & PF_WSCALE_MASK; } else { /* fixup other window */ - dst->max_win <<= dst->wscale & - PF_WSCALE_MASK; + dst->max_win = MIN(TCP_MAXWIN, + (u_int32_t)dst->max_win << + (dst->wscale & PF_WSCALE_MASK)); /* in case of a retrans SYN|ACK */ dst->wscale = 0; }