mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 19:40:12 +01:00
policy: don't retry connections where secrets requests failed
If the user canceled a secrets request, or we simply can't get secrets for the connection, invalidate it and make sure it doesn't get tried automatically again right after it fails.
This commit is contained in:
parent
52d0376148
commit
5fd3163a46
1 changed files with 8 additions and 0 deletions
|
|
@ -873,6 +873,14 @@ device_state_changed (NMDevice *device,
|
|||
*/
|
||||
if (connection && IS_ACTIVATING_STATE (old_state)) {
|
||||
g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE));
|
||||
|
||||
/* If the connection couldn't get the secrets it needed (ex because
|
||||
* the user canceled, or no secrets exist), there's no point in
|
||||
* automatically retrying because it's just going to fail anyway.
|
||||
*/
|
||||
if (reason == NM_DEVICE_STATE_REASON_NO_SECRETS)
|
||||
set_connection_auto_retries (connection, 0);
|
||||
|
||||
if (get_connection_auto_retries (connection) == 0)
|
||||
nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", nm_connection_get_id (connection));
|
||||
nm_connection_clear_secrets (connection);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue