]> git.ipfire.org Git - thirdparty/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, 24 Sep 2017 04:32:48 +0000 (00:32 -0400)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lxc/network.c

index c20d5980f70c398980b3b4721984f8466200b993..9561f70ecb4d8e5c63a5660ae5f0624e61e98b5f 100644 (file)
@@ -2322,7 +2322,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')
@@ -2531,7 +2531,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;
                }