From owner-svn-src-all@FreeBSD.ORG Sat Feb 20 22:29:28 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 E2B4C1065670; Sat, 20 Feb 2010 22:29:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2DE48FC14; Sat, 20 Feb 2010 22:29:28 +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 o1KMTSfj036805; Sat, 20 Feb 2010 22:29:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KMTSpW036802; Sat, 20 Feb 2010 22:29:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002202229.o1KMTSpW036802@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 20 Feb 2010 22:29:28 +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: r204147 - 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: Sat, 20 Feb 2010 22:29:29 -0000 Author: bz Date: Sat Feb 20 22:29:28 2010 New Revision: 204147 URL: http://svn.freebsd.org/changeset/base/204147 Log: Set curvnet earlier so that it also covers calls to sodisconnect(), which before were possibly panicing the system in ULP code in the VIMAGE case. Submitted by: Igor (igor ispsystem.com) MFC after: 5 days Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Feb 20 22:24:24 2010 (r204146) +++ head/sys/kern/uipc_socket.c Sat Feb 20 22:29:28 2010 (r204147) @@ -773,6 +773,8 @@ soconnect(struct socket *so, struct sock if (so->so_options & SO_ACCEPTCONN) return (EOPNOTSUPP); + + CURVNET_SET(so->so_vnet); /* * If protocol is connection-based, can only connect once. * Otherwise, if connected, try to disconnect first. This allows @@ -788,10 +790,9 @@ soconnect(struct socket *so, struct sock * biting us. */ so->so_error = 0; - CURVNET_SET(so->so_vnet); error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam, td); - CURVNET_RESTORE(); } + CURVNET_RESTORE(); return (error); }