aboutgitcodebugslistschat
path: root/pasta.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-09-12 22:24:06 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-09-13 05:31:51 +0200
commitd9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06 (patch)
treee54052bbaf6ca7f0a60999ad97967cc7412278ec /pasta.c
parentfc1be3d5ab4863c173796fe23f4ed00984d6ce8a (diff)
downloadpasst-d9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06.tar
passt-d9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06.tar.gz
passt-d9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06.tar.bz2
passt-d9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06.tar.lz
passt-d9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06.tar.xz
passt-d9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06.tar.zst
passt-d9f889a55a8bf4dc2e0caf61f35bc15dd6a68e06.zip
Correctly handle --netns-only in pasta_start_ns()
--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. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'pasta.c')
-rw-r--r--pasta.c4
1 files changed, 2 insertions, 2 deletions
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[])
pasta_child_pid = 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 |
CLONE_NEWUTS,
(void *)&arg);