- TCPT_RANGESET(tp->t_timer[TCPT_REXMT],
- (int)tp->t_srtt, TCPTV_MIN, TCPTV_MAX);
- if (tcpexprexmtbackoff) {
- TCPT_RANGESET(tp->t_timer[TCPT_REXMT],
- tp->t_timer[TCPT_REXMT] << tp->t_rxtshift,
- TCPTV_MIN, TCPTV_MAX);
- } else {
- TCPT_RANGESET(tp->t_timer[TCPT_REXMT],
- tp->t_timer[TCPT_REXMT] *
- tcp_backoff[tp->t_rxtshift - 1],
- TCPTV_MIN, TCPTV_MAX);
- }
-if (tcprexmtprint)
-printf("rexmt set to %d\n", tp->t_timer[TCPT_REXMT]);
+ tcpstat.tcps_rexmttimeo++;
+ rexmt = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
+ rexmt *= tcp_backoff[tp->t_rxtshift];
+ tp->t_rxtshift++;
+ TCPT_RANGESET(tp->t_timer[TCPT_REXMT], rexmt,
+ TCPTV_MIN, TCPTV_REXMTMAX);
+ /*
+ * If losing, let the lower level know
+ * and try for a better route.
+ */
+ if (tp->t_rxtshift >= TCP_MAXRXTSHIFT / 4 ||
+ rexmt >= 10 * PR_SLOWHZ)
+ in_losing(tp->t_inpcb);