Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 May 2013 20:07:28 +0200
From:      Marko Zec <zec@fer.hr>
To:        <freebsd-net@freebsd.org>
Cc:        Vijay Singh <vijju.singh@gmail.com>
Subject:   Re: VIMAGE and socreate
Message-ID:  <201305092007.28666.zec@fer.hr>
In-Reply-To: <CALCNsJTd9GHBNTvdWJmi%2BLbiCMqu9hf0RNuK04TbDT7sDC1PsA@mail.gmail.com>
References:  <CALCNsJTd9GHBNTvdWJmi%2BLbiCMqu9hf0RNuK04TbDT7sDC1PsA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305092007.28666.zec>