Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_input.c
Show First 20 Lines • Show All 1,676 Lines • ▼ Show 20 Lines | #endif | ||||
* fall back to non RFC1323 RTT calculation. Normalize | * fall back to non RFC1323 RTT calculation. Normalize | ||||
* timestamp if syncookies were used when this connection | * timestamp if syncookies were used when this connection | ||||
* was established. | * was established. | ||||
*/ | */ | ||||
if ((to.to_flags & TOF_TS) && (to.to_tsecr != 0)) { | if ((to.to_flags & TOF_TS) && (to.to_tsecr != 0)) { | ||||
to.to_tsecr -= tp->ts_offset; | to.to_tsecr -= tp->ts_offset; | ||||
if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) | if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) | ||||
to.to_tsecr = 0; | to.to_tsecr = 0; | ||||
else if (tp->t_flags & TF_PREVVALID && | |||||
tp->t_badrxtwin != 0 && SEQ_LT(to.to_tsecr, tp->t_badrxtwin)) | |||||
cc_cong_signal(tp, th, CC_RTO_ERR); | |||||
} | } | ||||
/* | /* | ||||
* Process options only when we get SYN/ACK back. The SYN case | * Process options only when we get SYN/ACK back. The SYN case | ||||
* for incoming connections is handled in tcp_syncache. | * for incoming connections is handled in tcp_syncache. | ||||
* According to RFC1323 the window field in a SYN (i.e., a <SYN> | * According to RFC1323 the window field in a SYN (i.e., a <SYN> | ||||
* or <SYN,ACK>) segment itself is never scaled. | * or <SYN,ACK>) segment itself is never scaled. | ||||
* XXX this is traditional behavior, may need to be cleaned up. | * XXX this is traditional behavior, may need to be cleaned up. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | if (tlen == 0) { | ||||
*/ | */ | ||||
if (ti_locked == TI_RLOCKED) | if (ti_locked == TI_RLOCKED) | ||||
INP_INFO_RUNLOCK(&V_tcbinfo); | INP_INFO_RUNLOCK(&V_tcbinfo); | ||||
ti_locked = TI_UNLOCKED; | ti_locked = TI_UNLOCKED; | ||||
TCPSTAT_INC(tcps_predack); | TCPSTAT_INC(tcps_predack); | ||||
/* | /* | ||||
* "bad retransmit" recovery. | * "bad retransmit" recovery without timestamps. | ||||
*/ | */ | ||||
if (tp->t_rxtshift == 1 && | if ((to.to_flags & TOF_TS) == 0 && | ||||
tp->t_rxtshift == 1 && | |||||
tp->t_flags & TF_PREVVALID && | tp->t_flags & TF_PREVVALID && | ||||
(int)(ticks - tp->t_badrxtwin) < 0) { | (int)(ticks - tp->t_badrxtwin) < 0) { | ||||
cc_cong_signal(tp, th, CC_RTO_ERR); | cc_cong_signal(tp, th, CC_RTO_ERR); | ||||
} | } | ||||
/* | /* | ||||
* Recalculate the transmit timer / rtt. | * Recalculate the transmit timer / rtt. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 974 Lines • ▼ Show 20 Lines | process_ACK: | ||||
/* | /* | ||||
* If we just performed our first retransmit, and the ACK | * If we just performed our first retransmit, and the ACK | ||||
* arrives within our recovery window, then it was a mistake | * arrives within our recovery window, then it was a mistake | ||||
* to do the retransmit in the first place. Recover our | * to do the retransmit in the first place. Recover our | ||||
* original cwnd and ssthresh, and proceed to transmit where | * original cwnd and ssthresh, and proceed to transmit where | ||||
* we left off. | * we left off. | ||||
*/ | */ | ||||
if (tp->t_rxtshift == 1 && tp->t_flags & TF_PREVVALID && | if (tp->t_rxtshift == 1 && | ||||
(int)(ticks - tp->t_badrxtwin) < 0) | tp->t_flags & TF_PREVVALID && | ||||
tp->t_badrxtwin && | |||||
SEQ_LT(to.to_tsecr, tp->t_badrxtwin)) | |||||
cc_cong_signal(tp, th, CC_RTO_ERR); | cc_cong_signal(tp, th, CC_RTO_ERR); | ||||
/* | /* | ||||
* If we have a timestamp reply, update smoothed | * If we have a timestamp reply, update smoothed | ||||
* round trip time. If no timestamp is present but | * round trip time. If no timestamp is present but | ||||
* transmit timer is running and timed sequence | * transmit timer is running and timed sequence | ||||
* number was acked, update smoothed round trip time. | * number was acked, update smoothed round trip time. | ||||
* Since we now have an rtt measurement, cancel the | * Since we now have an rtt measurement, cancel the | ||||
▲ Show 20 Lines • Show All 1,090 Lines • Show Last 20 Lines |