1
0
mirror of https://passt.top/passt synced 2024-06-23 11:37:04 +00:00

pasta_start_ns() always ends in parent context

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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2022-10-14 15:25:29 +11:00 committed by Stefano Brivio
parent 672a8cd80e
commit 01b4e71f7a

View File

@ -226,10 +226,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);
}
/**