From owner-freebsd-net@FreeBSD.ORG Fri May 28 04:40:03 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDEEC1065670 for ; Fri, 28 May 2010 04:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DC0358FC17 for ; Fri, 28 May 2010 04:40:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o4S4e3pd052206 for ; Fri, 28 May 2010 04:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o4S4e3sM052201; Fri, 28 May 2010 04:40:03 GMT (envelope-from gnats) Date: Fri, 28 May 2010 04:40:03 GMT Message-Id: <201005280440.o4S4e3sM052201@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" Cc: Subject: Re: kern/146845: [libc] close(2) returns error 54 (connection reset by peer) wrongly X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Lavrentiev, Anton \(NIH/NLM/NCBI\) \[C\]" List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 04:40:04 -0000 The following reply was made to PR kern/146845; it has been noted by GNATS. From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" To: "bug-followup@FreeBSD.org" Cc: Subject: Re: kern/146845: [libc] close(2) returns error 54 (connection reset by peer) wrongly Date: Fri, 28 May 2010 00:07:16 -0400 Hi Mikolaj and Robert, Thanks for following up on this issue! > It looks like SO_LINGER is not important to reproduce ECONNRESET. Indeed, it is not. > I am attaching the patch, which may not be a solution IMHO, it is not, unfortunately, a solution: it seems to clear ECONNRESET blindly and w/o distinguishing the situation when the remote end closes the connection prematurely (i.e. before acknowledging all data written from the local end) -- and that qualifies for the true "connection reset by peer" from close()... Anton Lavrentiev Contractor NIH/NLM/NCBI