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:
Qing Li 2006-02-23 21:14:34 +00:00
parent d2f4defee2
commit 4b8e98d632
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=155961
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;
}