]> git.proxmox.com Git - mirror_lxc.git/commitdiff
network: add missing checks for empty links
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 6 Sep 2017 09:51:03 +0000 (11:51 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Sun, 10 Sep 2017 18:00:32 +0000 (14:00 -0400)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lxc/network.c

index a7f054e795f95d7c050266e52caa86343c4c86fe..982f2eefb3d8c7abb76ff37fd45329dcaffd146d 100644 (file)
@@ -2350,7 +2350,7 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler)
                if (netdev->type != LXC_NET_VETH)
                        continue;
 
-               if (!is_ovs_bridge(netdev->link))
+               if (netdev->link[0] == '\0' || !is_ovs_bridge(netdev->link))
                        continue;
 
                if (netdev->priv.veth_attr.pair[0] != '\0')
@@ -2559,7 +2559,7 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
                }
                INFO("Removed interface \"%s\" from \"%s\"", hostveth, netdev->link);
 
-               if (!is_ovs_bridge(netdev->link)) {
+               if (netdev->link[0] == '\0' || !is_ovs_bridge(netdev->link)) {
                        netdev->priv.veth_attr.veth1[0] = '\0';
                        continue;
                }