Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 2023 21:44:52 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        freebsd-current@freebsd.org
Subject:   Re: Is it valid to combine CTLFLAG_TUN with CTLFLAG_VNET ?
Message-ID:  <b2338626-4f3a-d0f8-ce6b-365b8e393fec@selasky.org>
In-Reply-To: <ZC28li9kOc5e4rbc@FreeBSD.org>
References:  <94C1B333-9C0F-4874-BBB1-3E72F3DF3F6A@FreeBSD.org> <9dc65578-9312-1139-932f-396bc42e66b2@selasky.org> <ZC28li9kOc5e4rbc@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/5/23 20:23, Gleb Smirnoff wrote:
> What if we remove the CTLFLAG_VNET check from the code you posted above?
> I don't see anything going wrong, rather going right 😄
> 
> CTLFLAG_VNET will not mask away CTLFLAG_TUN.

Hi Gleb,

It's possible to bypass that check, but some work needs to be done 
first. Then all jails created, will also start from those sysctl tunable 
values.

The problem is, where does the VNET base pointer come from?

Especially those static sysctl's. You would need to make some design 
there I guess and look at the SYSINIT() order. When are SYSINIT's filled 
with tunable data's. And when is the default VNET created.

Because the data pointer passed to the register sysctl function is 
simply an offset pointer into a malloc'ed structure.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b2338626-4f3a-d0f8-ce6b-365b8e393fec>