From owner-freebsd-bugs Thu Mar 22 8:10:11 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 044B237B71D for ; Thu, 22 Mar 2001 08:10:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2MGA5673743; Thu, 22 Mar 2001 08:10:05 -0800 (PST) (envelope-from gnats) Date: Thu, 22 Mar 2001 08:10:05 -0800 (PST) Message-Id: <200103221610.f2MGA5673743@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Garrett Wollman Subject: Re: kern/25986: Socket would hang at LAST_ACK forever. Reply-To: Garrett Wollman Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/25986; it has been noted by GNATS. From: Garrett Wollman To: David Xu Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: kern/25986: Socket would hang at LAST_ACK forever. Date: Thu, 22 Mar 2001 11:07:54 -0500 (EST) < said: > Thank you! > it's a long standing bug, but seems no one want to fix it, don't know why! Probably because this ``fix'' would violate the TCP specification. (Not that we don't do that already for FINWAIT-2.) See the state diagram in RFC 793, page 23. There are three states in TCP in which the specification requires that we wait indefinitely for the other end to say something on the way to shutdown. In FINWAIT-2, we are waiting for a FIN from the other side, but they have already acknowledged our FIN). Since TCP models a dual-simplex octet stream, it is entirely legitimate for the other end to continue to transmit data after it has acknowledged our FIN and before it gives up itself. (They will be in CLOSE-WAIT when we are in FINWAIT-2.) In CLOSING and LAST-ACK we are waiting for the other end to acknowledge our FIN, them having already sent a FIN of their own. CLOSING is an exceedingly difficult state to get into, since most TCPs will ACK a FIN immediately, before delivering the end-of-session indication to the listening process. It is more dangerous to time out LAST-ACK than FINWAIT-2, because FINWAIT-2 sockets normally transition into TIME-WAIT whereas LAST-ACK sockets are destroyed immediately. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message