From owner-freebsd-net Tue Jun 26 10:48:43 2001 Delivered-To: freebsd-net@freebsd.org Received: from imo-d04.mx.aol.com (imo-d04.mx.aol.com [205.188.157.36]) by hub.freebsd.org (Postfix) with ESMTP id 6538A37B405 for ; Tue, 26 Jun 2001 10:48:36 -0700 (PDT) (envelope-from FastPathNow@netscape.net) Received: from FastPathNow@netscape.net by imo-d04.mx.aol.com (mail_out_v30.22.) id x.19.18960e3 (16222); Tue, 26 Jun 2001 13:47:59 -0400 (EDT) Received: from netscape.com (aimmail02.aim.aol.com [205.188.144.194]) by air-in01.mx.aol.com (v78_r3.8) with ESMTP; Tue, 26 Jun 2001 13:47:59 -0400 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? Mime-Version: 1.0 Message-ID: <70F9DB7F.6DE86C34.375A6AF3@netscape.net> References: <200106260624.IAA94869@info.iet.unipi.it> X-Mailer: Franklin Webmailer 1.0 Content-Type: text/plain; charset="ISO-8859-1" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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 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