From 9a175cc2cea75b98fc3c20381f58dcabf24ef529 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 29 Sep 2021 16:11:06 +0200 Subject: pasta: Allow specifying paths and names of namespaces Based on a patch from Giuseppe Scrivano, this adds the ability to: - specify paths and names of target namespaces to join, instead of a PID, also for user namespaces, with --userns - request to join or create a network namespace only, without entering or creating a user namespace, with --netns-only - specify the base directory for netns mountpoints, with --nsrun-dir Signed-off-by: Giuseppe Scrivano [sbrivio: reworked logic to actually join the given namespaces when they're not created, implemented --netns-only and --nsrun-dir, updated pasta demo script and man page] Signed-off-by: Stefano Brivio --- udp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udp.c') diff --git a/udp.c b/udp.c index 6b2ee36..0837cba 100644 --- a/udp.c +++ b/udp.c @@ -516,7 +516,7 @@ static int udp_splice_connect_ns(void *arg) a = (struct udp_splice_connect_ns_arg *)arg; - ns_enter(a->c->pasta_pid); + ns_enter(a->c); a->s = udp_splice_connect(a->c, a->v6, a->bound_sock, a->src, a->dst, UDP_BACK_TO_INIT); @@ -1004,7 +1004,7 @@ int udp_sock_init_ns(void *arg) struct ctx *c = (struct ctx *)arg; in_port_t dst; - ns_enter(c->pasta_pid); + ns_enter(c); for (dst = 0; dst < USHRT_MAX; dst++) { if (!bitmap_isset(c->udp.port_to_init, dst)) -- cgit v1.2.3