From owner-freebsd-net Tue Feb 13 9:21:51 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 5250037B4EC for ; Tue, 13 Feb 2001 09:21:49 -0800 (PST) Received: from curve.dellroad.org (curve.dellroad.org [10.1.1.30]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id JAA97475; Tue, 13 Feb 2001 09:21:45 -0800 (PST) Received: (from archie@localhost) by curve.dellroad.org (8.9.3/8.9.3) id JAA75141; Tue, 13 Feb 2001 09:21:44 -0800 (PST) (envelope-from archie) From: Archie Cobbs Message-Id: <200102131721.JAA75141@curve.dellroad.org> Subject: Re: [itojun@iijlab.net: accept(2) behavior with tcp RST right after handshake] In-Reply-To: <200102131611.LAA30820@khavrinen.lcs.mit.edu> "from Garrett Wollman at Feb 13, 2001 11:11:16 am" To: Garrett Wollman Date: Tue, 13 Feb 2001 09:21:44 -0800 (PST) Cc: net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL77 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Garrett Wollman writes: > > ISTR at one time you would instead get the actual sockaddr of the > > just-closed socket, rather than a bogus sockaddr... and that is the > > behavior one would expect. > > As itojun pointed out, accept() used to just block if the socket it > thought it was going to give you turned out not to be there at the > last moment. This was a killer for applications which expected > return from select() to be a reliable indicator of connections > waiting. > > I think the proposed fix is the best one we can get right now. > Restructuring the TCP code to handle this case doesn't make a whole > lot of sense to me (or apparently to itojun or jlemon either). Ah, my apologies for being foggy on the prior behavior. Given the circumstances, I agree returning the error from accept(2) seems like the best option. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message