From owner-svn-src-all@FreeBSD.ORG Thu May 27 15:27:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B7381065677; Thu, 27 May 2010 15:27:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BA108FC2F; Thu, 27 May 2010 15:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RFRVsQ010926; Thu, 27 May 2010 15:27:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RFRVpk010924; Thu, 27 May 2010 15:27:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005271527.o4RFRVpk010924@svn.freebsd.org> From: Robert Watson Date: Thu, 27 May 2010 15:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208601 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 15:27:31 -0000 Author: rwatson Date: Thu May 27 15:27:31 2010 New Revision: 208601 URL: http://svn.freebsd.org/changeset/base/208601 Log: When close() is called on a connected socket pair, SO_ISCONNECTED might be set but be cleared before the call to sodisconnect(). In this case, ENOTCONN is returned: suppress this error rather than returning it to userspace so that close() doesn't report an error improperly. PR: kern/144061 Reported by: Matt Reimer , Nikolay Denev , Mikolaj Golub MFC after: 3 days Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu May 27 15:17:06 2010 (r208600) +++ head/sys/kern/uipc_socket.c Thu May 27 15:27:31 2010 (r208601) @@ -665,8 +665,11 @@ soclose(struct socket *so) if (so->so_state & SS_ISCONNECTED) { if ((so->so_state & SS_ISDISCONNECTING) == 0) { error = sodisconnect(so); - if (error) + if (error) { + if (error == ENOTCONN) + error = 0; goto drop; + } } if (so->so_options & SO_LINGER) { if ((so->so_state & SS_ISDISCONNECTING) &&