Commit 5858c610 authored by Dan Williams's avatar Dan Williams

supplicant: make sure we remove the right interface

It shouldn't ever happen that two interface objects for the same
network interface are active at the same time, but make sure we
yell if it does.
parent 516ea8bf
......@@ -88,8 +88,13 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self,
g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self));
g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (iface));
ifname = nm_supplicant_interface_get_ifname (iface);
g_assert (ifname);
priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self);
g_return_if_fail (g_hash_table_lookup (priv->ifaces, ifname) == iface);
/* Ask wpa_supplicant to remove this interface */
op = nm_supplicant_interface_get_object_path (iface);
if (priv->running && priv->proxy && op) {
......@@ -98,8 +103,6 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self,
G_TYPE_INVALID);
}
ifname = nm_supplicant_interface_get_ifname (iface);
g_assert (ifname);
g_hash_table_remove (priv->ifaces, ifname);
}
......
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