core: ensure ActiveConnections are torn down when device is unavailable (bgo #676285)

If a device becomes unmanaged or unavailable (eg, due to loss of carrier, becoming
unmanaged, rfkilled, supplicant crashing, etc), the ActiveConnection would simply
set state to UNKNOWN and the Manager wouldn't tear it down and remove it from the
ActiveConnections property list. Instead, these states should be treated the same
as if the device was deactivated cleanly so that the AC will accurately reflect
the device state and the Manager will clean the AC up.

Fixes comment #12 in:
https://bugzilla.gnome.org/show_bug.cgi?id=676285
This commit is contained in:
Dan Williams 2013-05-02 14:39:51 -05:00
parent b39b4e9cf3
commit 22d2f571ce

View file

@ -318,6 +318,8 @@ device_state_changed (NMDevice *device, GParamSpec *pspec, NMActRequest *self)
break;
case NM_DEVICE_STATE_FAILED:
case NM_DEVICE_STATE_DISCONNECTED:
case NM_DEVICE_STATE_UNMANAGED:
case NM_DEVICE_STATE_UNAVAILABLE:
ac_state = NM_ACTIVE_CONNECTION_STATE_DEACTIVATED;
/* No longer need to pay attention to device state */