diff options
author | Dan Williams <dcbw@redhat.com> | 2014-02-08 07:52:24 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-02-21 09:45:06 -0600 |
commit | 12787f85656830be55296e96eb4553f3f301ab69 (patch) | |
tree | 9306f3561b8be90716b13c3c8c28d2cd2d1c81e6 | |
parent | f8dcab53d9ccdb9203d2f63872926c83413add52 (diff) | |
download | NetworkManager-12787f85656830be55296e96eb4553f3f301ab69.tar.gz |
mobile: fix disconnection on deactivation
When c4fc72c7 began using the DEACTIVATING state, the modem code
wasn't updated to handle this. Because it only checked for
activating or ACTIVATED states to determine whether the modem was
previously connected, and thus when an MM disconnect was needed,
when the device enters the DISCONNECTED state it was no longer
considered previously active, and not disconnected.
Also, remove the NEED_AUTH handling from the modem code's device
state switch, because it does not appear to be needed. The
modem will only enter NEED_AUTH when it requires PAP/CHAP secrets
during the connection attempt or when a PIN is required before
enabling the modem. In both cases the modem won't yet be connected,
so this code will never be hit.
-rw-r--r-- | src/modem-manager/nm-modem.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c index 998decaa4e..77ab710c7f 100644 --- a/src/modem-manager/nm-modem.c +++ b/src/modem-manager/nm-modem.c @@ -581,27 +581,21 @@ nm_modem_device_state_changed (NMModem *self, g_return_if_fail (NM_IS_MODEM (self)); - if (old_state >= NM_DEVICE_STATE_PREPARE && old_state <= NM_DEVICE_STATE_ACTIVATED) + if (old_state >= NM_DEVICE_STATE_PREPARE && old_state <= NM_DEVICE_STATE_DEACTIVATING) was_connected = TRUE; priv = NM_MODEM_GET_PRIVATE (self); /* Make sure we don't leave the serial device open */ switch (new_state) { - case NM_DEVICE_STATE_NEED_AUTH: - if (priv->ppp_manager) - break; - /* else fall through */ case NM_DEVICE_STATE_UNMANAGED: case NM_DEVICE_STATE_UNAVAILABLE: - case NM_DEVICE_STATE_FAILED: case NM_DEVICE_STATE_DISCONNECTED: - if (new_state != NM_DEVICE_STATE_NEED_AUTH) { - if (priv->act_request) { - cancel_get_secrets (self); - g_object_unref (priv->act_request); - priv->act_request = NULL; - } + case NM_DEVICE_STATE_FAILED: + if (priv->act_request) { + cancel_get_secrets (self); + g_object_unref (priv->act_request); + priv->act_request = NULL; } if (was_connected) { |