Subject: Re: iss calculation during TIME_WAIT ressurection ?

From: David Borman <[email-masked]>
Date: Fri, 5 Feb 1999 14:55:15 -0600 (CST)

Jayanth,

> The FreeBSD code and the 4.4BSD-Lite do not seem to have this fix.
>
> > > Looking at BSD code, it used the "rcv_nxt" field to calculate the new
> > > iss :
> > >
> > > 			if (tiflags & TH_SYN &&
> > >                             tp->t_state == TCPS_TIME_WAIT &&
> > >                             SEQ_GT(ti->ti_seq, tp->rcv_nxt)) {
> > >                                 iss = tp->rcv_nxt + TCP_ISSINCR;
> > >                                 tp = tcp_close(tp);
> > >                                 goto findpcb;
> > >                         }
> > >
> > > Is this a bug in the TCP code ? Should it not use snd_nxt ?
> > 
> > Yes.  This was fixed in the 4.4BSD code.

I don't know about FreeBSD, but the fix is there in the 4.4BSD-Lite
code:
                        if (tiflags & TH_SYN &&
                            tp->t_state == TCPS_TIME_WAIT &&
                            SEQ_GT(ti->ti_seq, tp->rcv_nxt)) {
                                iss = tp->snd_nxt + TCP_ISSINCR;
                                tp = tcp_close(tp);
                                goto findpcb;
                        }

Note that setting iss now uses tp->snd_next instead of tp->rcv_nxt.

			-David Borman, [email-masked]

---

From: Bill Fenner <[email-masked]>
Date: Fri, 5 Feb 1999 16:26:40 PST

It looks like the bug was still present in 4.4BSD-Lite, but fixed in
4.4BSD-Lite2.  FreeBSD started with -Lite and did a manual merge to
-Lite2 because the T/TCP modifications made simply merging diffs
problematic; it appears as though this fix was omitted.

  Bill

(The diff from -Lite to -Lite2 can be seen at
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/tcp_input.c.diff?r1=1.1.1.1&r2=1.1.1.2
).