diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -474,13 +474,12 @@ { INP_WLOCK_ASSERT(tptoinpcb(tp)); - /* XXXLAS: KASSERT that we're in recovery? */ - if (CC_ALGO(tp)->post_recovery != NULL) { tp->t_ccv.curack = th->th_ack; CC_ALGO(tp)->post_recovery(&tp->t_ccv); } - /* XXXLAS: EXIT_RECOVERY ? */ + EXIT_RECOVERY(tp->t_flags); + tp->t_bytes_acked = 0; tp->sackhint.delivered_data = 0; tp->sackhint.prr_delivered = 0; @@ -2799,8 +2798,8 @@ * If the congestion window was inflated to account * for the other side's cached packets, retract it. */ - if (IN_FASTRECOVERY(tp->t_flags)) { - if (SEQ_LT(th->th_ack, tp->snd_recover)) { + if (SEQ_LT(th->th_ack, tp->snd_recover)) { + if (IN_FASTRECOVERY(tp->t_flags)) { if (tp->t_flags & TF_SACK_PERMIT) if (V_tcp_do_prr && to.to_flags & TOF_SACK) { tcp_timer_activate(tp, TT_REXMT, 0); @@ -2812,10 +2811,7 @@ tcp_sack_partialack(tp, th); else tcp_newreno_partial_ack(tp, th); - } else - cc_post_recovery(tp, th); - } else if (IN_CONGRECOVERY(tp->t_flags)) { - if (SEQ_LT(th->th_ack, tp->snd_recover)) { + } else if (IN_CONGRECOVERY(tp->t_flags)) { if (V_tcp_do_prr) { tp->sackhint.delivered_data = BYTES_THIS_ACK(tp, th); tp->snd_fack = th->th_ack; @@ -2826,8 +2822,7 @@ tcp_do_prr_ack(tp, th, &to, SACK_CHANGE); (void) tcp_output(tp); } - } else - cc_post_recovery(tp, th); + } } /* * If we reach this point, ACK is not a duplicate, @@ -2978,12 +2973,11 @@ SEQ_GT(tp->snd_una, tp->snd_recover) && SEQ_LEQ(th->th_ack, tp->snd_recover)) tp->snd_recover = th->th_ack - 1; - /* XXXLAS: Can this be moved up into cc_post_recovery? */ + tp->snd_una = th->th_ack; if (IN_RECOVERY(tp->t_flags) && SEQ_GEQ(th->th_ack, tp->snd_recover)) { - EXIT_RECOVERY(tp->t_flags); + cc_post_recovery(tp, th); } - tp->snd_una = th->th_ack; if (tp->t_flags & TF_SACK_PERMIT) { if (SEQ_GT(tp->snd_una, tp->snd_recover)) tp->snd_recover = tp->snd_una;