From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: Re: [PATCH v2 08/10] Correctly handle --netns-only in pasta_start_ns() Date: Sun, 11 Sep 2022 18:26:31 +1000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7948060492274350697==" --===============7948060492274350697== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sat, Sep 10, 2022 at 05:25:36PM +1000, David Gibson wrote: > On Fri, Sep 09, 2022 at 04:34:20PM +0200, Stefano Brivio wrote: > > On Thu, 8 Sep 2022 13:59:05 +1000 > > David Gibson wrote: > >=20 > > > --netns-only is supposed to make pasta use only a network namespace, not > > > a user namespace. However, pasta_start_ns() has this backwards, and if > > > --netns-only is specified it creates a user namespace but *not* a netwo= rk > > > namespace. Correct this. > > >=20 > > > Signed-off-by: David Gibson > > > --- > > > pasta.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/pasta.c b/pasta.c > > > index 0fd45e4..7eac8e9 100644 > > > --- a/pasta.c > > > +++ b/pasta.c > > > @@ -244,8 +244,8 @@ void pasta_start_ns(struct ctx *c, int argc, char *= argv[]) > > > =20 > > > pasta_child_pid =3D clone(pasta_setup_ns, > > > ns_fn_stack + sizeof(ns_fn_stack) / 2, > > > - (c->netns_only ? 0 : CLONE_NEWNET) | > > > - CLONE_NEWIPC | CLONE_NEWPID | CLONE_NEWUSER | > > > + (c->netns_only ? 0 : CLONE_NEWUSER) | > > > + CLONE_NEWIPC | CLONE_NEWPID | CLONE_NEWNET | > >=20 > > Oh, funny, so it never worked in this case. > >=20 > > I thought anyway your plan was to drop --netns-only altogether, and if > > a --netns option is specified without --userns, then it's implied. Is > > that still on the table (outside the scope of this series I presume)? >=20 > Well.. having reduced the lifetome of netns_only to within conf() > alone, I felt a lot less urgency about removing it entirely. It might > still be nicer to remove it anyway; I'll have another look. Actually, I realized there is a reason to leave it in: just using --netns doesn't work with spawning a command, and spawning a command with netns but no userns might be useful. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --===============7948060492274350697== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUVCQ0FBZEZpRUVvVUx4V3U0L1dz MGRCK1h0Z3lwWTRnRXdZU0lGQW1NZG02RUFDZ2tRZ3lwWTRnRXcKWVNJK1Z3Ly9TakZZVUxNN3NV RkFBQSt1b2lKd1pHNnZZTHNVU2dlQzZTaVR1SmJSMnRvbnduRmtLampJR2NwSApVZ3hHbEFqNFEy VWxDbkNDamEzTlVGSHI4MU9jVXBXMDRmRGtSSEVaUVlaMnp3NXFNOE1MQzBUeU84TTZWT1ZYClZL M0x6UkZQSWpRcU5PdUNWVnU3RldubXJ3Njl2MTJrc0xCUXRiSTkvR2tKOVgyRTlRZ1ZyUzFqOGNT ZE9rTlcKbFlZQ2FDS2hSTFRRYTczcEJEbTYxYndBdU1ISnBuNHNKVkh5Wjd5ZVdVYWxQRC9meE1n Nmx1QWhIYllId0ZVSApnQmZObG4yUE11aUZGNmk2Zjc4R2pjRGxYaUFUYWVEM1ZDcWo5VVB0a2U4 c1NKNzRIZ0RPMVdtSWE0Tk1ra1ZECkdCUTRxZU5mWUhQbjFrV2hxWHlKVlU3V3FVbmRobksxSnVa YjdQUHVaUjl0cDBlZ2dybTA2dlhUOTVjaGQzSG0KL0JyR01DMFpyZm9rdTFKcDF1VVVVR082LzAz b29VUCt0cWZrTFRRdll6ZnY2Z0lhVWZnZExSZ2llWHBweUZURgpmSlVmRXNHQk02Q3h0S1EzYURT T3dJSXVXTFdlRytUL0lqVWpXV0NoQm50Y0VZMkRVZTFGdkk4Rkp2ZmJwSW1LCkhXeG1IN3VzRTdE WWZMZkVl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