Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2001 13:47:59 -0400
From:      FastPathNow@netscape.net
To:        luigi@info.iet.unipi.it
Cc:        freebsd-net@freebsd.org
Subject:   Re: TCPS_HAVERCVDFIN not considering all possible conditions?
Message-ID:  <70F9DB7F.6DE86C34.375A6AF3@netscape.net>
References:  <200106260624.IAA94869@info.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
Luigi,
A slightly more concise way of making the same change would be as follows:

#define TCPS_HAVERCVDFIN(s)     ( (s) >= TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2) )

With the bit mask based scheme you have suggested, it might also be possible to do interesting things things like state tracking for individal connections, such that every time we move into the next state instead of doing something like tp->t_state = TCPS_SYN_RCVD, we can have something like tp->t_state |= TCPS_SYN_RCVD . The only useful purpose that I can think of would be have a history of the past states in the t_state variable.

Even without this ORing change, it would still make writing macros such as the above easier

Regards
-AG

Luigi Rizzo <luigi@info.iet.unipi.it> wrote:
>
> this macro suggests that it would be better to
> define tcp states as a set of individual bits, so
> one does not have to do arithmetics on state IDs.
> 
>     cheers
>     luigi
> 
> > Currently in tcp_fsm.h its defined as :
> > #define TCPS_HAVERCVDFIN(s)     ((s) >= TCPS_TIME_WAIT)
> > 
> > when IMHO it should be: (to consider all possible cases of having recd a FIN?)
> > 
> > #define TCPS_HAVERCVDFIN(s)     ( ((s) >= TCPS_TIME_WAIT) || ((s) == TCPS_CLOSE_WAIT) || ((s) == TCPS_LAST_ACK) || ((s) == TCPS_CLOSING)  )
> > 
> > -AG
> > 
> > __________________________________________________________________
> > Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/
> > 
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-net" in the body of the message
> > 
> 
> 
__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?70F9DB7F.6DE86C34.375A6AF3>