This patch fixes the problem where the current TCP code can not handle

simultaneous open. Both the bug and the patch were verified using the
ANVL test suite.

PR:		kern/74935
Submitted by:	qingli (before I became committer)
Reviewed by:	andre
MFC after:	5 days
This commit is contained in:
qingli 2006-02-23 21:14:34 +00:00
parent c5c882e144
commit 2460d00021
3 changed files with 4 additions and 3 deletions

View File

@ -1421,7 +1421,7 @@ tcp_input(m, off0)
* SYN-SENT* -> SYN-RECEIVED*
* If there was no CC option, clear cached CC value.
*/
tp->t_flags |= TF_ACKNOW;
tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
callout_stop(tp->tt_rexmt);
tp->t_state = TCPS_SYN_RECEIVED;
}

View File

@ -338,7 +338,8 @@ tcp_output(struct tcpcb *tp)
* know that foreign host supports TAO, suppress sending segment.
*/
if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) {
flags &= ~TH_SYN;
if (tp->t_state != TCPS_SYN_RECEIVED)
flags &= ~TH_SYN;
off--, len++;
}

View File

@ -1421,7 +1421,7 @@ tcp_input(m, off0)
* SYN-SENT* -> SYN-RECEIVED*
* If there was no CC option, clear cached CC value.
*/
tp->t_flags |= TF_ACKNOW;
tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
callout_stop(tp->tt_rexmt);
tp->t_state = TCPS_SYN_RECEIVED;
}