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
This commit is contained in:
Dan Williams 2014-02-09 03:31:21 -06:00
parent 4611aec5c2
commit 5c1dee10cd
2 changed files with 18 additions and 2 deletions

View file

@ -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);
}

View file

@ -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);
}