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
This commit is contained in:
Richard Scheffenegger 2022-07-14 02:49:10 +02:00
parent a7399ea2dd
commit 66605ff791

View File

@ -1681,8 +1681,13 @@ timer:
tp->sackhint.sack_bytes_rexmit -= len; tp->sackhint.sack_bytes_rexmit -= len;
KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, KASSERT(tp->sackhint.sack_bytes_rexmit >= 0,
("sackhint bytes rtx >= 0")); ("sackhint bytes rtx >= 0"));
} else KASSERT((flags & TH_FIN) == 0,
("error while FIN with SACK rxmit"));
} else {
tp->snd_nxt -= len; tp->snd_nxt -= len;
if (flags & TH_FIN)
tp->snd_nxt--;
}
} }
SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */
switch (error) { switch (error) {