Unverified Commit eb8f5b73 by Wolfgang Bumiller Committed by Stéphane Graber

network: add missing checks for empty links

parent 6f7cf170
...@@ -2322,7 +2322,7 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler) ...@@ -2322,7 +2322,7 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler)
if (netdev->type != LXC_NET_VETH) if (netdev->type != LXC_NET_VETH)
continue; continue;
if (!is_ovs_bridge(netdev->link)) if (netdev->link[0] == '\0' || !is_ovs_bridge(netdev->link))
continue; continue;
if (netdev->priv.veth_attr.pair[0] != '\0') if (netdev->priv.veth_attr.pair[0] != '\0')
...@@ -2531,7 +2531,7 @@ bool lxc_delete_network_priv(struct lxc_handler *handler) ...@@ -2531,7 +2531,7 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
} }
INFO("Removed interface \"%s\" from \"%s\"", hostveth, netdev->link); 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'; netdev->priv.veth_attr.veth1[0] = '\0';
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment