git: 40fdc6d25f01 - main - tcp: provide correct snd_fack on post_recovery

From: Richard Scheffenegger <rscheff_at_FreeBSD.org>
Date: Sat, 24 Feb 2024 16:15:39 UTC
The branch main has been updated by rscheff:

URL: https://cgit.FreeBSD.org/src/commit/?id=40fdc6d25f01eea7767f1ba21efcde0e8e26b5eb

commit 40fdc6d25f01eea7767f1ba21efcde0e8e26b5eb
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2024-02-24 15:53:32 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2024-02-24 15:55:31 +0000

    tcp: provide correct snd_fack on post_recovery
    
    Ensure that snd_fack holds a valid value when doing
    the post_recovery CC processing, for preparation of
    the cc_cubic update, so that local pipe calculations
    can correctly refer to snd_fack during and after CC events.
    
    Reviewed By:            tuexen, #transport
    Sponsored by:           NetApp, Inc.
    Differential Revision:  https://reviews.freebsd.org/D43957
---
 sys/netinet/tcp_input.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index f023d7477790..8df975bcee54 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -479,6 +479,10 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th)
 	INP_WLOCK_ASSERT(tptoinpcb(tp));
 
 	if (CC_ALGO(tp)->post_recovery != NULL) {
+		if (SEQ_LT(tp->snd_fack, th->th_ack) ||
+		    SEQ_GT(tp->snd_fack, tp->snd_max)) {
+			tp->snd_fack = th->th_ack;
+		}
 		tp->t_ccv.curack = th->th_ack;
 		CC_ALGO(tp)->post_recovery(&tp->t_ccv);
 	}