From nobody Fri Jul 15 16:36:17 2022 X-Original-To: dev-commits-src-main@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 4LkxnY4vFbz4T4mH; Fri, 15 Jul 2022 16:36:17 +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 4LkxnY4Dwbz3Hl4; Fri, 15 Jul 2022 16:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657902977; 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=0kmbKpm6mNmc7uLzMCJTmoedKSeL09Nx456vPWxaKOU=; b=jussgT5nUMcUSRi+53Vuf80sP/vTzbV8TtMpvd6ov/CF6aYJD9i/1OT9iebXp6B8y0NFAm W06fLCeJ9/NTrxTFvx1/7gsSs2/9RMNtz3QSFDs7h6LSDyQMOILDlTPVEnPSZfFneO+kS9 8U3LI/5i0GAzudL35cU1EkZ409WR8B/vsrTsZxpWz8mGxY6wNSnm5E7y7f02gir7KTXIyo E8BiM45ze05QdpFbVUOBEtT8XDwkXd8rUXHlR6kDuT4IQbCauR1r0v+u8Xz5t5qoCkvzFy XVSF1umukw1tMHb6JnkYJXIn5ddJ3Y+eplNrF8vQ3+43mvwkjDSXMadP1yxKOw== 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 4LkxnY32ZLzpX1; Fri, 15 Jul 2022 16:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26FGaH9E038398; Fri, 15 Jul 2022 16:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26FGaHsM038397; Fri, 15 Jul 2022 16:36:17 GMT (envelope-from git) Date: Fri, 15 Jul 2022 16:36:17 GMT Message-Id: <202207151636.26FGaHsM038397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 66605ff791b1 - main - tcp: Undo the increase in sequence number by 1 due to the FIN flag in case of a transient error. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66605ff791b12a2c3bb4570379db0e14d29fca4c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657902977; 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=0kmbKpm6mNmc7uLzMCJTmoedKSeL09Nx456vPWxaKOU=; b=yb3exKM8GAWIiV4+RuXub/6A5kppKqetm//DcQ04qric/OM7Byaty0/b/btxf93nhv4bGT VPoODO71lIjPKlt45yV5NpVEjVTnrd5nCBhDl4800ovnfSX4wuQJQxHzgzb2Xbwsm2FpAd tVzoexuQCpiVyeLK+io9r+XjIBk2gMSNIgWQB76he6Bn25E/RtdI6WM32Tx666WEV8teES gv2Oa6KcHdlMXu7MuGKq/pmkUOaRz0WFTt9J4pk4Q/Ru+b7djh9T62s/8JdUR3vZbJ45WE ij0x94kR5DpGAQ9bTGc5XSqpDTf2LrBQdAg0OKLu+udYMiFSoMCHPtV2n9dYQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657902977; a=rsa-sha256; cv=none; b=JQLOu3lVMdPLIvl4aMaIDuSim4Ghp3cp9N31xz0wK+FxRPfIqW6cHgcdHkc93DOZOCvWBM 7vvZW/dhiQs5kT0LaI8cEWj5WfJDIPqeY1FYfvZrur0jOYKIBrUj4dgS/xZmwTOBbjxjZM cwCviDg57Ty2U/UovAU4tLiBlrJ/MGUWW8YgIV0MD+7PWYvkt8t26qOpa0cCzd9vIJuxew 4OAx6F2JSRaD1GxkQveufDkgvjw3XlcD60cRHHj0LVvyNj1U5JfAaSShNPvMjxwJ6yechg y49TI3lVIsPWDz8yDmq56j2rvRuQoHLMW4lQM2HrZTTjoqZ7lw1j+6To4ALg8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=66605ff791b12a2c3bb4570379db0e14d29fca4c commit 66605ff791b12a2c3bb4570379db0e14d29fca4c Author: Richard Scheffenegger AuthorDate: 2022-07-14 00:49:10 +0000 Commit: Richard Scheffenegger CommitDate: 2022-07-14 01:18:19 +0000 tcp: Undo the increase in sequence number by 1 due to the FIN flag in case of a transient error. If an error occurs while processing a TCP segment with some data and the FIN flag, the back out of the sequence number advance does not take into account the increase by 1 due to the FIN flag. Reviewed By: jch, gnn, #transport, tuexen Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D2970 --- sys/netinet/tcp_output.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index cd6238f10401..d2f946034c60 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1681,8 +1681,13 @@ timer: tp->sackhint.sack_bytes_rexmit -= len; KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, ("sackhint bytes rtx >= 0")); - } else + KASSERT((flags & TH_FIN) == 0, + ("error while FIN with SACK rxmit")); + } else { tp->snd_nxt -= len; + if (flags & TH_FIN) + tp->snd_nxt--; + } } SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ switch (error) {