| 1708 | } |
| 1709 | |
| 1710 | void |
| 1711 | tcp_setpersist(struct tcpcb *tp) |
| 1712 | { |
| 1713 | int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; |
| 1714 | int tt; |
| 1715 | |
| 1716 | tp->t_flags &= ~TF_PREVVALID; |
| 1717 | if (tcp_timer_active(tp, TT_REXMT)) |
| 1718 | panic("tcp_setpersist: retransmit pending"); |
| 1719 | /* |
| 1720 | * Start/restart persistence timer. |
| 1721 | */ |
| 1722 | TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], |
| 1723 | tcp_persmin, tcp_persmax); |
| 1724 | tcp_timer_activate(tp, TT_PERSIST, tt); |
| 1725 | if (tp->t_rxtshift < TCP_MAXRXTSHIFT) |
| 1726 | tp->t_rxtshift++; |
| 1727 | } |
| 1728 | |
| 1729 | /* |
| 1730 | * Insert TCP options according to the supplied parameters to the place |
no test coverage detected