From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH v2 08/10] Correctly handle --netns-only in pasta_start_ns() Date: Fri, 09 Sep 2022 16:34:20 +0200 Message-ID: <20220909163420.32970c5b@elisabeth> In-Reply-To: <20220908035907.1750314-9-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2977921206064785714==" --===============2977921206064785714== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, 8 Sep 2022 13:59:05 +1000 David Gibson wrote: > --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 network > 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 | Oh, funny, so it never worked in this case. 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 Stefano --===============2977921206064785714==--