From owner-freebsd-net@FreeBSD.ORG Fri May 28 09:26:41 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 157F11065672; Fri, 28 May 2010 09:26:41 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 4164A8FC16; Fri, 28 May 2010 09:26:39 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so300789fga.13 for ; Fri, 28 May 2010 02:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :organization:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=uNyo1xCGZEwv8h+q4gRAuPR7+feoPZOnZ7jQyi2tZkg=; b=vioN0GsGHhSgE/ityYlQ3zHVqh/DFqFjs7NNRavqJokyG2g9ppIKrOn/ZXqtgwM5v3 HEqfCAUfR6DkVqUrIIWtMNU3+uH7UpuN2GsDWdEh4S7otX2GA8qLoeLkt7Mwqxy2r6/U WevHeq1Ygs1xf3uAAhHwgslddmG+6sVxtnkfc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=L/LiSSNoa5nkbeeQt4DjImsiu1RqK7vjCvqDK5rjdzgOtD9pF85RSe6T3Uf5woW38j 4vilyij/I+UAq5chryIAeO8Brf63qyJAMipH3ikJxRJ6wAM8sI/Uvx8cye8RyWx/C+B8 V0105yaLcfiQr2MHzjCp99qz0vmLanSamCcMM= Received: by 10.204.10.152 with SMTP id p24mr4524965bkp.94.1275038798625; Fri, 28 May 2010 02:26:38 -0700 (PDT) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id l1sm9633159bkl.2.2010.05.28.02.26.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 May 2010 02:26:36 -0700 (PDT) From: Mikolaj Golub To: "Lavrentiev\, Anton \(NIH\/NLM\/NCBI\) \[C\]" Organization: TOA Ukraine References: <201005280440.o4S4e3sM052201@freefall.freebsd.org> Date: Fri, 28 May 2010 12:26:33 +0300 In-Reply-To: <201005280440.o4S4e3sM052201@freefall.freebsd.org> (Anton Lavrentiev's message of "Fri, 28 May 2010 04:40:03 GMT") Message-ID: <86mxvkqsvq.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-net@FreeBSD.org, "Robert N. M. Watson" , bug-followup@FreeBSD.org 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 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 09:26:41 -0000 On Fri, 28 May 2010 04:40:03 GMT Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: LA> IMHO, it is not, unfortunately, a solution: it seems to clear ECONNRESET LA> blindly and w/o distinguishing the situation when the remote end closes the LA> connection prematurely (i.e. before acknowledging all data written from the LA> local end) -- and that qualifies for the true "connection reset by peer" LA> from close()... I am not very familiar with the socket/tcp code but it looks for me that it might not make any difference. I can be wrong here but the situation you have described as true "connection reset by peer" seems to have the following path in the code: soclose() -> sodisconnect() -> tcp_usr_disconnect() -> tcp_disconnect() But tcp_disconnect() does not return error, so we will not have ECONNRESET error in any case. May be you have a good test suite to reproduce this situation? :-) -- Mikolaj Golub