summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-02-09 03:31:21 -0600
committerDan Williams <dcbw@redhat.com>2014-02-21 09:45:06 -0600
commit5c1dee10cde3cc7cf74718650702dd124d46aa75 (patch)
tree9b2ca1b2957eb9166d06915f80486fbd1fab9bb7
parent4611aec5c2412464184be16b736168d1bc73f2d3 (diff)
downloadNetworkManager-5c1dee10cde3cc7cf74718650702dd124d46aa75.tar.gz
mobile: only change state to NEED_AUTH during activation (rh #1058308)
Auth requests only happen during activation and there's no need to request secrets at any other time. Ensure that the device state won't change to NEED_AUTH except when activating. (There's a case in NMModemBroadband where set_mm_enabled() when the modem is locked may cause this, but we'll solve this a different way later.) https://bugzilla.redhat.com/show_bug.cgi?id=1058308
-rw-r--r--src/devices/nm-device-bt.c10
-rw-r--r--src/devices/nm-device-modem.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/src/devices/nm-device-bt.c b/src/devices/nm-device-bt.c
index e22c96eee3..3e5b693354 100644
--- a/src/devices/nm-device-bt.c
+++ b/src/devices/nm-device-bt.c
@@ -423,7 +423,15 @@ ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data)
static void
modem_auth_requested (NMModem *modem, gpointer user_data)
{
- nm_device_state_changed (NM_DEVICE (user_data),
+ NMDevice *device = NM_DEVICE (user_data);
+
+ /* Auth requests (PIN, PAP/CHAP passwords, etc) only get handled
+ * during activation.
+ */
+ if (!nm_device_is_activating (device))
+ return;
+
+ nm_device_state_changed (device,
NM_DEVICE_STATE_NEED_AUTH,
NM_DEVICE_STATE_REASON_NONE);
}
diff --git a/src/devices/nm-device-modem.c b/src/devices/nm-device-modem.c
index 0bed60cd80..e047c03e11 100644
--- a/src/devices/nm-device-modem.c
+++ b/src/devices/nm-device-modem.c
@@ -113,7 +113,15 @@ modem_prepare_result (NMModem *modem,
static void
modem_auth_requested (NMModem *modem, gpointer user_data)
{
- nm_device_state_changed (NM_DEVICE (user_data),
+ NMDevice *device = NM_DEVICE (user_data);
+
+ /* Auth requests (PIN, PAP/CHAP passwords, etc) only get handled
+ * during activation.
+ */
+ if (!nm_device_is_activating (device))
+ return;
+
+ nm_device_state_changed (device,
NM_DEVICE_STATE_NEED_AUTH,
NM_DEVICE_STATE_REASON_NONE);
}