device: reset the capabilities to class defaults when reseting them

Otherwise the lacking IS_SOFTWARE capability may cuase the connections not to
be available on software devices and the devices would get garbage-collected at
the end of unrealize().
This commit is contained in:
Lubomir Rintel 2016-01-04 12:07:33 +01:00
parent 48695df023
commit da1abaa1db

View file

@ -2057,6 +2057,8 @@ nm_device_unrealize (NMDevice *self, gboolean remove_resources, GError **error)
g_clear_pointer (&priv->initial_hw_addr, g_free);
priv->capabilities = NM_DEVICE_CAP_NM_SUPPORTED;
if (NM_DEVICE_GET_CLASS (self)->get_generic_capabilities)
priv->capabilities |= NM_DEVICE_GET_CLASS (self)->get_generic_capabilities (self);
g_object_notify (G_OBJECT (self), NM_DEVICE_CAPABILITIES);
priv->real = FALSE;