* Re-transmit timeout! If we drop the PCB we will return 1, otherwise * we will setup to retransmit the lowest seq number outstanding. */
| 5577 | * we will setup to retransmit the lowest seq number outstanding. |
| 5578 | */ |
| 5579 | static int |
| 5580 | rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) |
| 5581 | { |
| 5582 | int32_t rexmt; |
| 5583 | struct inpcb *inp; |
| 5584 | int32_t retval = 0; |
| 5585 | bool isipv6; |
| 5586 | |
| 5587 | inp = tp->t_inpcb; |
| 5588 | if (tp->t_timers->tt_flags & TT_STOPPED) { |
| 5589 | return (1); |
| 5590 | } |
| 5591 | if (ctf_progress_timeout_check(tp, false)) { |
| 5592 | tcp_log_end_status(tp, TCP_EI_STATUS_RETRAN); |
| 5593 | rack_log_progress_event(rack, tp, tick, PROGRESS_DROP, __LINE__); |
| 5594 | tcp_set_inp_to_drop(inp, ETIMEDOUT); |
| 5595 | return (1); |
| 5596 | } |
| 5597 | rack->r_ctl.rc_hpts_flags &= ~PACE_TMR_RXT; |
| 5598 | if (TCPS_HAVEESTABLISHED(tp->t_state) && |
| 5599 | (tp->snd_una == tp->snd_max)) { |
| 5600 | /* Nothing outstanding .. nothing to do */ |
| 5601 | return (0); |
| 5602 | } |
| 5603 | /* |
| 5604 | * Retransmission timer went off. Message has not been acked within |
| 5605 | * retransmit interval. Back off to a longer retransmit interval |
| 5606 | * and retransmit one segment. |
| 5607 | */ |
| 5608 | rack_remxt_tmr(tp); |
| 5609 | if ((rack->r_ctl.rc_resend == NULL) || |
| 5610 | ((rack->r_ctl.rc_resend->r_flags & RACK_RWND_COLLAPSED) == 0)) { |
| 5611 | /* |
| 5612 | * If the rwnd collapsed on |
| 5613 | * the one we are retransmitting |
| 5614 | * it does not count against the |
| 5615 | * rxt count. |
| 5616 | */ |
| 5617 | tp->t_rxtshift++; |
| 5618 | } |
| 5619 | if (tp->t_rxtshift > TCP_MAXRXTSHIFT) { |
| 5620 | tp->t_rxtshift = TCP_MAXRXTSHIFT; |
| 5621 | KMOD_TCPSTAT_INC(tcps_timeoutdrop); |
| 5622 | retval = 1; |
| 5623 | tcp_log_end_status(tp, TCP_EI_STATUS_RETRAN); |
| 5624 | tcp_set_inp_to_drop(rack->rc_inp, |
| 5625 | (tp->t_softerror ? (uint16_t) tp->t_softerror : ETIMEDOUT)); |
| 5626 | goto out; |
| 5627 | } |
| 5628 | if (tp->t_state == TCPS_SYN_SENT) { |
| 5629 | /* |
| 5630 | * If the SYN was retransmitted, indicate CWND to be limited |
| 5631 | * to 1 segment in cc_conn_init(). |
| 5632 | */ |
| 5633 | tp->snd_cwnd = 1; |
| 5634 | } else if (tp->t_rxtshift == 1) { |
| 5635 | /* |
| 5636 | * first retransmit; record ssthresh and cwnd so they can be |
no test coverage detected