Unverified Commit 1f6af532 by Stéphane Graber Committed by GitHub

Merge pull request #2922 from brauner/2019-04-02/ovs_fixes

network: fix network device removal
parents 0d861d57 78ab281c
...@@ -2574,18 +2574,17 @@ bool lxc_delete_network_priv(struct lxc_handler *handler) ...@@ -2574,18 +2574,17 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
* interface to the network namespace, we have to destroy it. * interface to the network namespace, we have to destroy it.
*/ */
ret = lxc_netdev_delete_by_index(netdev->ifindex); ret = lxc_netdev_delete_by_index(netdev->ifindex);
if (-ret == ENODEV) { if (ret < 0) {
INFO("Interface \"%s\" with index %d already " if (errno != ENODEV) {
"deleted or existing in different network "
"namespace",
netdev->name[0] != '\0' ? netdev->name : "(null)",
netdev->ifindex);
} else if (ret < 0) {
WARN("Failed to remove interface \"%s\" with index %d", WARN("Failed to remove interface \"%s\" with index %d",
netdev->name[0] != '\0' ? netdev->name : "(null)", netdev->name[0] != '\0' ? netdev->name : "(null)",
netdev->ifindex); netdev->ifindex);
goto clear_ifindices; goto clear_ifindices;
} }
INFO("Interface \"%s\" with index %d already deleted or existing in different network namespace",
netdev->name[0] != '\0' ? netdev->name : "(null)",
netdev->ifindex);
}
INFO("Removed interface \"%s\" with index %d", INFO("Removed interface \"%s\" with index %d",
netdev->name[0] != '\0' ? netdev->name : "(null)", netdev->name[0] != '\0' ? netdev->name : "(null)",
netdev->ifindex); netdev->ifindex);
......
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