From owner-freebsd-net@FreeBSD.ORG Thu May 9 18:09:34 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C47B050F for ; Thu, 9 May 2013 18:09:34 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDDE99B for ; Thu, 9 May 2013 18:09:33 +0000 (UTC) Received: from tpx32.lan (89.164.242.51) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.309.2; Thu, 9 May 2013 20:08:24 +0200 From: Marko Zec To: Subject: Re: VIMAGE and socreate Date: Thu, 9 May 2013 20:07:28 +0200 User-Agent: KMail/1.9.10 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201305092007.28666.zec@fer.hr> X-Originating-IP: [89.164.242.51] Cc: Vijay Singh X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 18:09:34 -0000 On Thursday 09 May 2013 19:53:05 Vijay Singh wrote: > In 8.3, socreate() does: > > so = soalloc(CRED_TO_VNET(cred)); > > Is there a reason why we don't do soalloc(curvnet) here? Since > CURVNET_SET() doesn't update the vnet in the thread ucred, which is > passed into socreate(), it doesn't take effect for socket creations. Because CRED_TO_VNET(cred) and curvnet are fundamentally different things: #define CRED_TO_VNET(cr) (cr)->cr_prison->pr_vnet #define curvnet curthread->td_vnet and moreover at the time soalloc() gets called curvnet is (usually) NULL. Marko