From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 422F05A0274 for ; Fri, 14 Oct 2022 06:25:49 +0200 (CEST) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4MpYGW4Pd0z4xH3; Fri, 14 Oct 2022 15:25:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1665721539; bh=Iq/rYxbNXJ3S/iNgY4GzYG37sXDhMEbNRwLcvojWpew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vrdnfa6QQj55D5yNj4LM+GdxRgn3ypVWHItjdr6/Dogui5z1xAk1zzw5U/jerUVAw ufMfrIot4im7RCFDfwD+9RUKpOuzM5RhH9dwQWpWDkw0G2LF0gAVQE/F27BdkF4lh6 ZX+jSAmkREcfI2uU+wONvli65lLX9XBjvfqYD+rg= From: David Gibson To: Stefano Brivio Subject: [PATCH v2 03/11] pasta_start_ns() always ends in parent context Date: Fri, 14 Oct 2022 15:25:29 +1100 Message-Id: <20221014042537.2466015-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221014042537.2466015-1-david@gibson.dropbear.id.au> References: <20221014042537.2466015-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: JFFO7BA2JIT27ZMSPN6WJAFE74NYHJDH X-Message-ID-Hash: JFFO7BA2JIT27ZMSPN6WJAFE74NYHJDH X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, David Gibson X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: <> Archived-At: List-Archive: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The end of pasta_start_ns() has a test against pasta_child_pid, testing if we're in the parent or the child. However we started the child running the pasta_setup_ns function which always exec()s or exit()s, so if we return from the clone() we are always in the parent, making that test unnecessary. Signed-off-by: David Gibson --- pasta.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pasta.c b/pasta.c index 97cd318..1569590 100644 --- a/pasta.c +++ b/pasta.c @@ -225,10 +225,7 @@ void pasta_start_ns(struct ctx *c, int argc, char *argv[]) drop_caps(); - if (pasta_child_pid) { - NS_CALL(pasta_wait_for_ns, c); - return; - } + NS_CALL(pasta_wait_for_ns, c); } /** -- 2.37.3