diff options
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/nm-device-ethernet.c | 10 | ||||
-rw-r--r-- | src/devices/nm-device-macsec.c | 8 | ||||
-rw-r--r-- | src/devices/nm-device.c | 24 | ||||
-rw-r--r-- | src/devices/nm-device.h | 8 |
4 files changed, 23 insertions, 27 deletions
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 672ae3cd52..dd9d4c7715 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -272,7 +272,7 @@ device_state_changed (NMDevice *device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_DISCONNECTED)) { priv = NM_DEVICE_ETHERNET_GET_PRIVATE (NM_DEVICE_ETHERNET (device)); - priv->auth_retries = NM_DEVICE_802_1X_AUTH_RETRIES_UNSET; + priv->auth_retries = NM_DEVICE_AUTH_RETRIES_UNSET; } } @@ -284,7 +284,7 @@ nm_device_ethernet_init (NMDeviceEthernet *self) priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetPrivate); self->_priv = priv; - priv->auth_retries = NM_DEVICE_802_1X_AUTH_RETRIES_UNSET; + priv->auth_retries = NM_DEVICE_AUTH_RETRIES_UNSET; priv->s390_options = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free); } @@ -677,8 +677,8 @@ handle_auth_or_fail (NMDeviceEthernet *self, priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - if (!nm_device_802_1x_auth_retries_try_next (NM_DEVICE (self), - &priv->auth_retries)) + if (!nm_device_auth_retries_try_next (NM_DEVICE (self), + &priv->auth_retries)) return NM_ACT_STAGE_RETURN_FAILURE; nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); @@ -1344,7 +1344,7 @@ deactivate (NMDevice *device) GError *error = NULL; /* Clear wired secrets tries when deactivating */ - priv->auth_retries = NM_DEVICE_802_1X_AUTH_RETRIES_UNSET; + priv->auth_retries = NM_DEVICE_AUTH_RETRIES_UNSET; nm_clear_g_source (&priv->pppoe_wait_id); diff --git a/src/devices/nm-device-macsec.c b/src/devices/nm-device-macsec.c index d8e2cc9dbb..3d95d73478 100644 --- a/src/devices/nm-device-macsec.c +++ b/src/devices/nm-device-macsec.c @@ -484,8 +484,8 @@ handle_auth_or_fail (NMDeviceMacsec *self, priv = NM_DEVICE_MACSEC_GET_PRIVATE (self); - if (!nm_device_802_1x_auth_retries_try_next (NM_DEVICE (self), - &priv->auth_retries)) + if (!nm_device_auth_retries_try_next (NM_DEVICE (self), + &priv->auth_retries)) return NM_ACT_STAGE_RETURN_FAILURE; nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); @@ -750,7 +750,7 @@ device_state_changed (NMDevice *device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_DISCONNECTED)) { priv = NM_DEVICE_MACSEC_GET_PRIVATE (NM_DEVICE_MACSEC (device)); - priv->auth_retries = NM_DEVICE_802_1X_AUTH_RETRIES_UNSET; + priv->auth_retries = NM_DEVICE_AUTH_RETRIES_UNSET; } } @@ -812,7 +812,7 @@ nm_device_macsec_init (NMDeviceMacsec *self) { NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE (self); - priv->auth_retries = NM_DEVICE_802_1X_AUTH_RETRIES_UNSET; + priv->auth_retries = NM_DEVICE_AUTH_RETRIES_UNSET; } static void diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 36cfc9c9af..4be9a3687f 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -14024,42 +14024,38 @@ nm_device_get_supplicant_timeout (NMDevice *self) } gboolean -nm_device_802_1x_auth_retries_try_next (NMDevice *self, int *p_auth_retries) +nm_device_auth_retries_try_next (NMDevice *self, int *p_auth_retries) { - NMConnection *applied_connection; - NMSetting8021x *security; + NMSettingConnection *s_con; int auth_retries = *p_auth_retries; - if (G_UNLIKELY (auth_retries == NM_DEVICE_802_1X_AUTH_RETRIES_UNSET)) { + if (G_UNLIKELY (auth_retries == NM_DEVICE_AUTH_RETRIES_UNSET)) { auth_retries = -1; - applied_connection = nm_device_get_applied_connection (NM_DEVICE (self)); - if (applied_connection) { - security = nm_connection_get_setting_802_1x (applied_connection); - if (security) - auth_retries = nm_setting_802_1x_get_auth_retries (security); - } + s_con = NM_SETTING_CONNECTION (nm_device_get_applied_setting (self, NM_TYPE_SETTING_CONNECTION)); + if (s_con) + auth_retries = nm_setting_connection_get_auth_retries (s_con); if (auth_retries == -1) { gs_free char *value = NULL; value = nm_config_data_get_connection_default (NM_CONFIG_GET_DATA, - "802-1x.auth-retries", + "connection.auth-retries", self); auth_retries = _nm_utils_ascii_str_to_int64 (value, 10, -1, G_MAXINT32, -1); } if (auth_retries == 0) - auth_retries = NM_DEVICE_802_1X_AUTH_RETRIES_INFINITY; + auth_retries = NM_DEVICE_AUTH_RETRIES_INFINITY; else if (auth_retries == -1) - auth_retries = NM_DEVICE_802_1X_AUTH_RETRIES_DEFAULT; + auth_retries = NM_DEVICE_AUTH_RETRIES_DEFAULT; else nm_assert (auth_retries > 0); *p_auth_retries = auth_retries; } - if (auth_retries == NM_DEVICE_802_1X_AUTH_RETRIES_INFINITY) + if (auth_retries == NM_DEVICE_AUTH_RETRIES_INFINITY) return TRUE; if (auth_retries <= 0) { nm_assert (auth_retries == 0); diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 6e4aa0d9e2..90f9c1fc03 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -736,11 +736,11 @@ void nm_device_update_permanent_hw_address (NMDevice *self, gboolean force_freez void nm_device_update_dynamic_ip_setup (NMDevice *self); guint nm_device_get_supplicant_timeout (NMDevice *self); -#define NM_DEVICE_802_1X_AUTH_RETRIES_UNSET -1 -#define NM_DEVICE_802_1X_AUTH_RETRIES_INFINITY -2 -#define NM_DEVICE_802_1X_AUTH_RETRIES_DEFAULT 3 +#define NM_DEVICE_AUTH_RETRIES_UNSET -1 +#define NM_DEVICE_AUTH_RETRIES_INFINITY -2 +#define NM_DEVICE_AUTH_RETRIES_DEFAULT 3 -gboolean nm_device_802_1x_auth_retries_try_next (NMDevice *self, int *p_auth_retry); +gboolean nm_device_auth_retries_try_next (NMDevice *self, int *p_auth_retry); gboolean nm_device_hw_addr_get_cloned (NMDevice *self, NMConnection *connection, |