Clarify comments and clean up some code
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3588 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1717,7 +1717,8 @@ nm_device_state_changed (NMDevice *device, NMDeviceState state)
|
|||||||
case NM_DEVICE_STATE_UNAVAILABLE:
|
case NM_DEVICE_STATE_UNAVAILABLE:
|
||||||
if (old_state == NM_DEVICE_STATE_UNMANAGED)
|
if (old_state == NM_DEVICE_STATE_UNMANAGED)
|
||||||
nm_device_bring_up (device, TRUE);
|
nm_device_bring_up (device, TRUE);
|
||||||
/* Fall through */
|
/* Fall through, so when the device needs to be deactivated due to
|
||||||
|
* eg carrier changes we actually deactivate it */
|
||||||
case NM_DEVICE_STATE_DISCONNECTED:
|
case NM_DEVICE_STATE_DISCONNECTED:
|
||||||
if (old_state != NM_DEVICE_STATE_UNAVAILABLE)
|
if (old_state != NM_DEVICE_STATE_UNAVAILABLE)
|
||||||
nm_device_interface_deactivate (NM_DEVICE_INTERFACE (device));
|
nm_device_interface_deactivate (NM_DEVICE_INTERFACE (device));
|
||||||
@@ -1766,7 +1767,9 @@ nm_device_set_managed (NMDevice *device, gboolean managed)
|
|||||||
g_return_if_fail (NM_IS_DEVICE (device));
|
g_return_if_fail (NM_IS_DEVICE (device));
|
||||||
|
|
||||||
priv = NM_DEVICE_GET_PRIVATE (device);
|
priv = NM_DEVICE_GET_PRIVATE (device);
|
||||||
if (priv->managed != managed) {
|
if (priv->managed == managed)
|
||||||
|
return;
|
||||||
|
|
||||||
priv->managed = managed;
|
priv->managed = managed;
|
||||||
nm_info ("(%s): now %s", nm_device_get_iface (device), managed ? "managed" : "unmanaged");
|
nm_info ("(%s): now %s", nm_device_get_iface (device), managed ? "managed" : "unmanaged");
|
||||||
|
|
||||||
@@ -1779,6 +1782,5 @@ nm_device_set_managed (NMDevice *device, gboolean managed)
|
|||||||
|
|
||||||
/* If now managed, jump to unavailable */
|
/* If now managed, jump to unavailable */
|
||||||
nm_device_state_changed (device, managed ? NM_DEVICE_STATE_UNAVAILABLE : NM_DEVICE_STATE_UNMANAGED);
|
nm_device_state_changed (device, managed ? NM_DEVICE_STATE_UNAVAILABLE : NM_DEVICE_STATE_UNMANAGED);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user