summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Ferraris <arnaud.ferraris@collabora.com>2020-03-26 10:06:14 +0100
committerArnaud Ferraris <arnaud.ferraris@collabora.com>2020-03-27 11:01:41 +0100
commitdf20a98aa4fb374c6debe23a6fc8c3badffa523f (patch)
tree0029dea2122ec8b1d0b0c040b18e55a54225a828
parentc8b752c9735147d38832aa70027196c7458f6cc9 (diff)
nm-device-modem: deactivate device when modem unlocked
When the modem is unlocked externally to NetworkManager, it is kept in the 'need-auth' state. The current connection activation continues as if nothing had changed, and the secrets request for the PIN code (which is no longer necessary) eventually times out. The device state is then changed to 'failed', meaning there won't be a new try at activating the default connection automatically. In order to prevent this, and retry activating the default connection when the modem gets unlocked, we change the device state to 'deactivating' when we identify the modem has been unlocked externally. Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
-rw-r--r--src/devices/wwan/nm-device-modem.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 8e5b70bded..a2f2e7a6f8 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -384,6 +384,15 @@ modem_state_cb (NMModem *modem,
*/
nm_modem_set_mm_enabled (priv->modem, priv->rf_enabled);
+ if (dev_state == NM_DEVICE_STATE_NEED_AUTH) {
+ /* The modem was unlocked externally to NetworkManager,
+ deactivate so the default connection can be
+ automatically activated again */
+ nm_device_state_changed (device,
+ NM_DEVICE_STATE_DEACTIVATING,
+ NM_DEVICE_STATE_REASON_MODEM_AVAILABLE);
+ }
+
/* Now allow connections without a PIN to be available */
nm_device_recheck_available_connections (device);
}