diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-09-27 19:00:47 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-09-29 15:32:16 +0200 |
commit | b80ee4a72c84ff51549a2d0b7278746681965d5b (patch) | |
tree | aafda304b0d45ef34c7d9b1b700476e212ccb668 | |
parent | 46dc919e687992aac16d3038fe6b4e8c4474a10d (diff) | |
download | NetworkManager-b80ee4a72c84ff51549a2d0b7278746681965d5b.tar.gz |
core: make auto-connect-blocked-reason more specific
Distinguish between connections blocked from autoconnecting by user
request and connections blocked because they failed (and would fail
again).
Later, the reason will be used to unblock failed connection when some
conditions change.
-rw-r--r-- | src/devices/wwan/nm-device-modem.c | 2 | ||||
-rw-r--r-- | src/nm-policy.c | 8 | ||||
-rw-r--r-- | src/settings/nm-settings-connection.c | 3 | ||||
-rw-r--r-- | src/settings/nm-settings-connection.h | 5 |
4 files changed, 10 insertions, 8 deletions
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c index 0b0b0a1bb8..b3e1064fc4 100644 --- a/src/devices/wwan/nm-device-modem.c +++ b/src/devices/wwan/nm-device-modem.c @@ -392,7 +392,7 @@ device_state_changed (NMDevice *device, */ if (connection) { nm_settings_connection_set_autoconnect_blocked_reason (connection, - NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_BLOCKED); + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED); } break; default: diff --git a/src/nm-policy.c b/src/nm-policy.c index 3c569d5974..81fce466ba 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1193,7 +1193,7 @@ pending_ac_state_changed (NMActiveConnection *ac, guint state, guint reason, NMP * loop. */ con = nm_active_connection_get_settings_connection (ac); - nm_settings_connection_set_autoconnect_blocked_reason (con, NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_BLOCKED); + nm_settings_connection_set_autoconnect_blocked_reason (con, NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED); schedule_activate_check (self, nm_active_connection_get_device (ac)); /* Cleanup */ @@ -1267,7 +1267,7 @@ auto_activate_device (NMPolicy *self, error->message); g_error_free (error); nm_settings_connection_set_autoconnect_blocked_reason (best_connection, - NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_BLOCKED); + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED); schedule_activate_check (self, device); return; } @@ -1473,7 +1473,7 @@ block_autoconnect_for_device (NMPolicy *self, NMDevice *device) if (nm_device_check_connection_compatible (device, NM_CONNECTION (connection))) { nm_settings_connection_set_autoconnect_blocked_reason (connection, - NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_BLOCKED); + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST); } } } @@ -1806,7 +1806,7 @@ device_state_changed (NMDevice *device, _LOGD (LOGD_DEVICE, "blocking autoconnect of connection '%s' by user request", nm_settings_connection_get_id (connection)); nm_settings_connection_set_autoconnect_blocked_reason (connection, - NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_BLOCKED); + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST); } } } diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 3f9a2d523f..15d51baafc 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -2621,7 +2621,8 @@ nm_settings_connection_set_autoconnect_blocked_reason (NMSettingsConnection *sel { g_return_if_fail (NM_IN_SET (reason, NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_UNBLOCKED, - NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_BLOCKED, + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST, + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED, NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NO_SECRETS)); NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->autoconnect_blocked_reason = reason; } diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h index c50b4515a3..6dcc4f40c0 100644 --- a/src/settings/nm-settings-connection.h +++ b/src/settings/nm-settings-connection.h @@ -84,8 +84,9 @@ typedef enum { /*< skip >*/ typedef enum { NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_UNBLOCKED = 0, - NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_BLOCKED = 1, - NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NO_SECRETS = 2, + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST = 1, + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED = 2, + NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NO_SECRETS = 3, } NMSettingsAutoconnectBlockedReason; struct _NMSettingsConnectionCallId; |