mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-11 22:40:23 +01:00
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.
This commit is contained in:
parent
f8dcab53d9
commit
12787f8565
1 changed files with 6 additions and 12 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue