TCP PRR: Patch div/0 in tcp_prr_partialack

With clearing of recover_fs in bc7ee8e5bc, 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.
This commit is contained in:
Richard Scheffenegger 2021-01-26 16:06:32 +01:00
parent 84761f3df5
commit 6a376af0cd

View file

@ -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;