From owner-freebsd-net Thu Mar 8 21:56:38 2001 Delivered-To: freebsd-net@freebsd.org Received: from coconut.itojun.org (coconut.itojun.org [210.160.95.97]) by hub.freebsd.org (Postfix) with ESMTP id 576B837B71A for ; Thu, 8 Mar 2001 21:56:24 -0800 (PST) (envelope-from itojun@itojun.org) Received: from kiwi.itojun.org (localhost.itojun.org [127.0.0.1]) by coconut.itojun.org (8.9.3+3.2W/3.7W/smtpfeed 1.06) with ESMTP id OAA25800; Fri, 9 Mar 2001 14:56:21 +0900 (JST) To: Jonathan Lemon Cc: Wietse Venema , Arjan.deVet@adv.iae.nl, net@freebsd.org, postfix-users@postfix.org In-reply-to: jlemon's message of Thu, 08 Mar 2001 16:16:11 CST. <20010308161611.B78851@prism.flugsvamp.com> X-Template-Reply-To: itojun@itojun.org X-Template-Return-Receipt-To: itojun@itojun.org X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 Subject: Re: [itojun@iijlab.net: accept(2) behavior with tcp RST right after handshake] From: itojun@iijlab.net Date: Fri, 09 Mar 2001 14:56:21 +0900 Message-ID: <25798.984117381@coconut.itojun.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >From the server's point of view: > > + TCP/IP handshake from client, allocate protocol control blocks > + receive data from client > + client resets connection, pcb is destroyed > >Exactly why the client resets the connection isn't my concern at >the moment. Some stacks may place a timeout on the FIN_WAIT state, >and forcibly reset the reset the connection when the timer expires. >Alternatively, the client may crash, and then RST in response to >an ACK transmitted by the server. Or the other end may have set >SO_LINGER, which will cause close() to send a RST. > >The unix-domain bug is because we were treating sockets in the >DISCONNECTED state identically across all protocols, which turns >out not to be the case. > >As for any data that already exists in the socket buffer on the >server when the connection is aborted, I believe that the correct >thing to do is discard it. This is the historical precedent, and >is supported by the current standards. > >Below is a patch that will fix the behavior for unix-domain sockets. from code inspection on netbsd, I guess you'd need to do something for other sys/net* families. maybe we need another per-domain/per-socket flag for this? itojun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message