The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3310
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Closes #3137. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From ffcc7dd0cb2ecb312c1d73e529d26aef532a73cd Mon Sep 17 00:00:00 2001 From: Christian Brauner <christian.brau...@ubuntu.com> Date: Thu, 19 Mar 2020 16:08:44 +0100 Subject: [PATCH] network: fix ovs removal Closes #3137. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- src/lxc/network.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/lxc/network.c b/src/lxc/network.c index 0e79500f1f..484cdfc16c 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -3492,29 +3492,19 @@ bool lxc_delete_network_priv(struct lxc_handler *handler) if (hostveth[0] == '\0') goto clear_ifindices; - ret = lxc_netdev_delete_by_name(hostveth); - if (ret < 0) { - WARN("Failed to remove interface \"%s\" from \"%s\"", - hostveth, netdev->link); - goto clear_ifindices; - } - INFO("Removed interface \"%s\" from \"%s\"", hostveth, netdev->link); + if (!is_ovs_bridge(netdev->link)) { + ret = lxc_netdev_delete_by_name(hostveth); + if (ret < 0) + WARN("Failed to remove interface \"%s\" from \"%s\"", hostveth, netdev->link); - if (netdev->link[0] == '\0' || !is_ovs_bridge(netdev->link)) { - netdev->priv.veth_attr.veth1[0] = '\0'; - netdev->ifindex = 0; - netdev->priv.veth_attr.ifindex = 0; - goto clear_ifindices; - } + INFO("Removed interface \"%s\" from \"%s\"", hostveth, netdev->link); + } else if (!is_empty_string(netdev->link)) { + ret = lxc_ovs_delete_port(netdev->link, hostveth); + if (ret < 0) + WARN("Failed to remove port \"%s\" from openvswitch bridge \"%s\"", hostveth, netdev->link); - /* Delete the openvswitch port. */ - ret = lxc_ovs_delete_port(netdev->link, hostveth); - if (ret < 0) - WARN("Failed to remove port \"%s\" from openvswitch " - "bridge \"%s\"", hostveth, netdev->link); - else - INFO("Removed port \"%s\" from openvswitch bridge \"%s\"", - hostveth, netdev->link); + INFO("Removed port \"%s\" from openvswitch bridge \"%s\"", hostveth, netdev->link); + } clear_ifindices: /* We need to clear any ifindices we recorded so liblxc won't
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel