VIMAGE and socreate

Marko Zec zec at fer.hr
Thu May 9 18:09:34 UTC 2013


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


More information about the freebsd-net mailing list