summaryrefslogtreecommitdiff
path: root/src/devices/wwan/nm-device-modem.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-10-25 21:29:45 +0200
committerThomas Haller <thaller@redhat.com>2017-10-31 19:35:33 +0100
commitcb2aa6bd4c75234bfb1faf1a3a2bb3ab64a0ccf8 (patch)
treee174ae93fe2252e863ccb52bc533e62463af0665 /src/devices/wwan/nm-device-modem.c
parent3828ba3b0e3ab9868372b3df143ffa11613a99b9 (diff)
downloadNetworkManager-cb2aa6bd4c75234bfb1faf1a3a2bb3ab64a0ccf8.tar.gz
policy: move blocking autoconnect from NMDeviceModem to NMPolicy
Only NMPolicy should be concerned with handling autoconnect, and blocking it. Move the code. Note that there is a slight possible change in behavior, as the order of when the connection is blocked changes, based on the different times when the device changed signal gets executed. But that shouldn't be a problem.
Diffstat (limited to 'src/devices/wwan/nm-device-modem.c')
-rw-r--r--src/devices/wwan/nm-device-modem.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 7f2bb9389a..22fb8c673d 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -364,9 +364,8 @@ device_state_changed (NMDevice *device,
{
NMDeviceModem *self = NM_DEVICE_MODEM (device);
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self);
- NMSettingsConnection *connection = nm_device_get_settings_connection (device);
- g_assert (priv->modem);
+ g_return_if_fail (priv->modem);
if (new_state == NM_DEVICE_STATE_UNAVAILABLE &&
old_state < NM_DEVICE_STATE_UNAVAILABLE) {
@@ -374,30 +373,7 @@ device_state_changed (NMDevice *device,
_LOGI (LOGD_MB, "modem state '%s'",
nm_modem_state_to_string (nm_modem_get_state (priv->modem)));
}
-
nm_modem_device_state_changed (priv->modem, new_state, old_state);
-
- switch (nm_device_state_reason_check (reason)) {
- case NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED:
- case NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING:
- case NM_DEVICE_STATE_REASON_GSM_SIM_NOT_INSERTED:
- case NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED:
- case NM_DEVICE_STATE_REASON_GSM_SIM_PUK_REQUIRED:
- case NM_DEVICE_STATE_REASON_GSM_SIM_WRONG:
- case NM_DEVICE_STATE_REASON_SIM_PIN_INCORRECT:
- case NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED:
- case NM_DEVICE_STATE_REASON_GSM_APN_FAILED:
- /* Block autoconnect of the just-failed connection for situations
- * where a retry attempt would just fail again.
- */
- if (connection) {
- nm_settings_connection_autoconnect_blocked_reason_set (connection,
- NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED);
- }
- break;
- default:
- break;
- }
}
static NMDeviceCapabilities