nspawn: explicitly remove veth links after use (#3111)

* sd-netlink: permit RTM_DELLINK messages with no ifindex

This is useful for removing network interfaces by name.

* nspawn: explicitly remove veth links we created after use

Sometimes the kernel keeps veth links pinned after the namespace they have been
joined to died. Let's hence explicitly remove veth links after use.

Fixes: #2173
This commit is contained in:
Lennart Poettering
2016-04-25 17:36:51 +02:00
committed by Daniel Mack
parent 4f4d6ee4be
commit d2773e59de
4 changed files with 51 additions and 1 deletions
+2
View File
@@ -3713,6 +3713,7 @@ int main(int argc, char *argv[]) {
}
expose_port_flush(arg_expose_ports, &exposed);
(void) remove_veth_links(veth_name, arg_network_veth_extra);
}
finish:
@@ -3745,6 +3746,7 @@ finish:
}
expose_port_flush(arg_expose_ports, &exposed);
(void) remove_veth_links(veth_name, arg_network_veth_extra);
free(arg_directory);
free(arg_template);