Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 2021 11:01:39 GMT
From:      Richard Scheffenegger <rscheff@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 76dd854f47f4 - stable/13 - TCP PRR: Patch div/0 in tcp_prr_partialack
Message-ID:  <202101291101.10TB1djv027474@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by rscheff:

URL: https://cgit.FreeBSD.org/src/commit/?id=76dd854f47f4aea703093647a158f280d383ea6d

commit 76dd854f47f4aea703093647a158f280d383ea6d
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2021-01-26 15:06:32 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2021-01-29 10:57:21 +0000

    TCP PRR: Patch div/0 in tcp_prr_partialack
    
    Adding a safety net prior to the division in tcp_prr_partialack
    function, which was missed in D28114.
    
    Reviewed-by: tuexen, mm, @transport
    
    MFC: 3 days
    
    Differential Revision: https://reviews.freebsd.org/D28326
    
    (cherry picked from commit 6a376af0cd212be4e16d013d35a0e2eec1dbb8ae)
---
 sys/netinet/tcp_input.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 4b8f91ed9d0b..459b78cd444a 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -510,7 +510,6 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th)
 	}
 	/* XXXLAS: EXIT_RECOVERY ? */
 	tp->t_bytes_acked = 0;
-	tp->sackhint.recover_fs = 0;
 }
 
 /*
@@ -3948,10 +3947,13 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th)
 	/*
 	 * Proportional Rate Reduction
 	 */
-	if (pipe > tp->snd_ssthresh)
+	if (pipe > tp->snd_ssthresh) {
+		if (tp->sackhint.recover_fs == 0)
+			tp->sackhint.recover_fs =
+			    max(1, tp->snd_nxt - tp->snd_una);
 		snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh /
 		    tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit;
-	else {
+	} else {
 		if (V_tcp_do_prr_conservative)
 			limit = tp->sackhint.prr_delivered -
 			    tp->sackhint.sack_bytes_rexmit;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101291101.10TB1djv027474>