diff options
author | Richard Scheffenegger <rscheff@FreeBSD.org> | 2021-01-26 15:06:32 +0000 |
---|---|---|
committer | Richard Scheffenegger <rscheff@FreeBSD.org> | 2021-01-26 15:06:32 +0000 |
commit | 6a376af0cd212be4e16d013d35a0e2eec1dbb8ae (patch) | |
tree | 06e0852e874dd8a925facc7ab6f303d3f79b3e78 | |
parent | 84761f3df508aed50783b60f028af9d98a684b41 (diff) | |
download | src-6a376af0cd212be4e16d013d35a0e2eec1dbb8ae.tar.gz src-6a376af0cd212be4e16d013d35a0e2eec1dbb8ae.zip |
TCP PRR: Patch div/0 in tcp_prr_partialack
With clearing of recover_fs in bc7ee8e5bc555, div/0
was observed while processing partial_acks.
Suspect that rewind of an erraneous RTO may be
causing this - with the above change, recover_fs
would no longer retained at the last calculated
value, and reset. But CC_RTO_ERR can reenable
IN_RECOVERY(), without setting this again.
Adding a safety net prior to the division in that
function, which I missed in D28114.
-rw-r--r-- | sys/netinet/tcp_input.c | 8 |
1 files 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; |