mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-10 18:47:32 +00:00
Merge pull request #1601 from brauner/2017-05-30/veth_fixes
network: don't delete net devs we didn't create
This commit is contained in:
commit
bf3e9c154e
@ -2873,7 +2873,8 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_delete:
|
out_delete:
|
||||||
lxc_netdev_delete_by_name(veth1);
|
if (netdev->ifindex != 0)
|
||||||
|
lxc_netdev_delete_by_name(veth1);
|
||||||
if (!netdev->priv.veth_attr.pair)
|
if (!netdev->priv.veth_attr.pair)
|
||||||
free(veth1);
|
free(veth1);
|
||||||
free(veth2);
|
free(veth2);
|
||||||
@ -3201,7 +3202,7 @@ bool lxc_delete_network(struct lxc_handler *handler)
|
|||||||
/* Explicitly delete host veth device to prevent lingering
|
/* Explicitly delete host veth device to prevent lingering
|
||||||
* devices. We had issues in LXD around this.
|
* devices. We had issues in LXD around this.
|
||||||
*/
|
*/
|
||||||
if (netdev->type == LXC_NET_VETH && !am_unpriv()) {
|
if (netdev->ifindex != 0 && netdev->type == LXC_NET_VETH && !am_unpriv()) {
|
||||||
char *hostveth;
|
char *hostveth;
|
||||||
if (netdev->priv.veth_attr.pair) {
|
if (netdev->priv.veth_attr.pair) {
|
||||||
hostveth = netdev->priv.veth_attr.pair;
|
hostveth = netdev->priv.veth_attr.pair;
|
||||||
|
Loading…
Reference in New Issue
Block a user