summary refs log tree commit diff
path: root/src/devices/wwan/nm-device-modem.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-04-11 21:28:04 +0200
committerMichael Biebl <biebl@debian.org>2020-04-11 21:28:04 +0200
commit1e5977b62f896e844b548c3007ace9e1dfa7f9ed (patch)
tree7a7416ed410e72b6200f3d860fd315ec11cc106b /src/devices/wwan/nm-device-modem.c
parentb012fa6e1d808e0736c009799c62d835cbfcc1dd (diff)
New upstream version 1.23.90 upstream/1.23.90
Diffstat (limited to 'src/devices/wwan/nm-device-modem.c')
-rw-r--r--src/devices/wwan/nm-device-modem.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 3de5ae07..a2f2e7a6 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -156,7 +156,7 @@ modem_prepare_result (NMModem *modem,
 	}
 
 	priv->stage1_state = NM_DEVICE_STAGE_STATE_COMPLETED;
-	nm_device_activate_schedule_stage1_device_prepare (device);
+	nm_device_activate_schedule_stage1_device_prepare (device, FALSE);
 }
 
 static void
@@ -191,7 +191,7 @@ modem_auth_result (NMModem *modem, GError *error, gpointer user_data)
 	}
 
 	priv->stage1_state = NM_DEVICE_STAGE_STATE_INIT;
-	nm_device_activate_schedule_stage1_device_prepare (device);
+	nm_device_activate_schedule_stage1_device_prepare (device, FALSE);
 }
 
 static void
@@ -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);
 	}
@@ -605,7 +614,6 @@ static NMActStageReturn
 act_stage2_config (NMDevice *device, NMDeviceStateReason *out_failure_reason)
 {
 	nm_modem_act_stage2_config (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem);
-
 	return NM_ACT_STAGE_RETURN_SUCCESS;
 }
 
@@ -843,9 +851,9 @@ dispose (GObject *object)
 		nm_clear_pointer (&priv->modem, nm_modem_unclaim);
 	}
 
-	g_clear_pointer (&priv->device_id, g_free);
-	g_clear_pointer (&priv->operator_code, g_free);
-	g_clear_pointer (&priv->apn, g_free);
+	nm_clear_g_free (&priv->device_id);
+	nm_clear_g_free (&priv->operator_code);
+	nm_clear_g_free (&priv->apn);
 
 	G_OBJECT_CLASS (nm_device_modem_parent_class)->dispose (object);
 }