]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Restore interfaces to the correct namespace on error 3596/head
authorBlair Steven <blair.steven@alliedtelesis.co.nz>
Tue, 8 Dec 2020 22:23:39 +0000 (11:23 +1300)
committerBlair Steven <blair.steven@alliedtelesis.co.nz>
Tue, 8 Dec 2020 22:45:15 +0000 (11:45 +1300)
If the container unexpectedly exists we may need to restore physical
interfaces back into the main namespace in a tidy way.

Signed-off-by: Blair Steven <blair.steven@alliedtelesis.co.nz>
src/lxc/start.c

index 7bf7f8a2fb132a5d803192ec82b8b723a4b5f142..863ae123b3e9b2b0a4e986d705d7243d220fe0da 100644 (file)
@@ -2144,6 +2144,7 @@ out_detach_blockdev:
 
 out_delete_network:
        lxc_abort(handler);
+       lxc_restore_phys_nics_to_netns(handler);
        lxc_delete_network(handler);
        detach_block_device(handler->conf);
        lxc_end(handler);