Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 2,099 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* Received initial SYN in SYN-SENT[*] state => | * Received initial SYN in SYN-SENT[*] state => | ||||
* simultaneous open. | * simultaneous open. | ||||
* If it succeeds, connection is * half-synchronized. | * If it succeeds, connection is * half-synchronized. | ||||
* Otherwise, do 3-way handshake: | * Otherwise, do 3-way handshake: | ||||
* SYN-SENT -> SYN-RECEIVED | * SYN-SENT -> SYN-RECEIVED | ||||
* SYN-SENT* -> SYN-RECEIVED* | * SYN-SENT* -> SYN-RECEIVED* | ||||
*/ | */ | ||||
tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN); | tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN | TF_SONOTCONN); | ||||
tcp_timer_activate(tp, TT_REXMT, 0); | tcp_timer_activate(tp, TT_REXMT, 0); | ||||
tcp_state_change(tp, TCPS_SYN_RECEIVED); | tcp_state_change(tp, TCPS_SYN_RECEIVED); | ||||
} | } | ||||
INP_WLOCK_ASSERT(tp->t_inpcb); | INP_WLOCK_ASSERT(tp->t_inpcb); | ||||
/* | /* | ||||
* Advance th->th_seq to correspond to first data byte. | * Advance th->th_seq to correspond to first data byte. | ||||
▲ Show 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* In SYN_RECEIVED state, the ack ACKs our SYN, so enter | * In SYN_RECEIVED state, the ack ACKs our SYN, so enter | ||||
* ESTABLISHED state and continue processing. | * ESTABLISHED state and continue processing. | ||||
* The ACK was checked above. | * The ACK was checked above. | ||||
*/ | */ | ||||
case TCPS_SYN_RECEIVED: | case TCPS_SYN_RECEIVED: | ||||
TCPSTAT_INC(tcps_connects); | TCPSTAT_INC(tcps_connects); | ||||
if (tp->t_flags & TF_INCQUEUE) { | if (tp->t_flags & TF_SONOTCONN) { | ||||
tp->t_flags &= ~TF_INCQUEUE; | /* | ||||
* Usually SYN_RECEIVED had been created from a LISTEN, | |||||
* and solisten_enqueue() has already marked the socket | |||||
* layer as connected. If it didn't, which can happen | |||||
* only with an accept_filter(9), then the tp is marked | |||||
* with TF_SONOTCONN. The other reason for this mark | |||||
* to to be set is a simultaneous open, a SYN_RECEIVED | |||||
rscheff: "to" got duplicated here. | |||||
* that had been created from SYN_SENT. | |||||
*/ | |||||
tp->t_flags &= ~TF_SONOTCONN; | |||||
soisconnected(so); | soisconnected(so); | ||||
} | } | ||||
/* Do window scaling? */ | /* Do window scaling? */ | ||||
if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == | if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == | ||||
(TF_RCVD_SCALE|TF_REQ_SCALE)) { | (TF_RCVD_SCALE|TF_REQ_SCALE)) { | ||||
tp->rcv_scale = tp->request_r_scale; | tp->rcv_scale = tp->request_r_scale; | ||||
} | } | ||||
tp->snd_wnd = tiwin; | tp->snd_wnd = tiwin; | ||||
▲ Show 20 Lines • Show All 1,639 Lines • Show Last 20 Lines |
"to" got duplicated here.