mirror of
git://github.com/lxc/lxc
synced 2025-09-05 14:09:35 +00:00
lxc_unshare: fix network device handling
We were passing the wrong PID. Fix this! Link: https://discuss.linuxcontainers.org/t/problem-with-moving-interface-new-network-namespace-in-lxc-unshare Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
@@ -416,7 +416,7 @@ int main(int argc, char *argv[])
|
||||
if (lpid == 0) {
|
||||
char buf[256];
|
||||
|
||||
ret = snprintf(buf, 256, "%d", lpid);
|
||||
ret = snprintf(buf, 256, "%d", pid);
|
||||
if (ret < 0 || ret >= 256)
|
||||
_exit(EXIT_FAILURE);
|
||||
|
||||
@@ -425,8 +425,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (wait_for_pid(lpid) != 0)
|
||||
SYSERROR("Could not move interface \"%s\" into container %d",
|
||||
ifname, lpid);
|
||||
SYSERROR("Could not move interface \"%s\" into container %d", ifname, lpid);
|
||||
}
|
||||
|
||||
free_ifname_list();
|
||||
|
Reference in New Issue
Block a user