diff options
author | Thomas Haller <thaller@redhat.com> | 2017-11-02 10:56:30 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-11-02 11:41:01 +0100 |
commit | 32acaccf2af0dbf8154e5221972130eeaa67a718 (patch) | |
tree | c6c9b91b5b359a05106807f39e8a3eda842a9dbe /src/devices/nm-device-ethernet.c | |
parent | 6705c71263825aebd690e67acba095c9c837f2a4 (diff) | |
download | NetworkManager-32acaccf2af0dbf8154e5221972130eeaa67a718.tar.gz |
device: move tracking auth_retry to NMDevice
It will be also used by NMDeviceWifi. It might waste a 4 bytes for device types
that don't require authentication. But it deduplicates code.
Diffstat (limited to 'src/devices/nm-device-ethernet.c')
-rw-r--r-- | src/devices/nm-device-ethernet.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index dd9d4c7715..7807100f5b 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -115,8 +115,6 @@ typedef struct _NMDeviceEthernetPrivate { DcbWait dcb_wait; guint dcb_timeout_id; - int auth_retries; - bool dcb_handle_carrier_changes:1; } NMDeviceEthernetPrivate; @@ -262,18 +260,8 @@ device_state_changed (NMDevice *device, NMDeviceState old_state, NMDeviceStateReason reason) { - NMDeviceEthernetPrivate *priv; - if (new_state > NM_DEVICE_STATE_ACTIVATED) wired_secrets_cancel (NM_DEVICE_ETHERNET (device)); - - if (NM_IN_SET (new_state, - NM_DEVICE_STATE_ACTIVATED, - NM_DEVICE_STATE_FAILED, - NM_DEVICE_STATE_DISCONNECTED)) { - priv = NM_DEVICE_ETHERNET_GET_PRIVATE (NM_DEVICE_ETHERNET (device)); - priv->auth_retries = NM_DEVICE_AUTH_RETRIES_UNSET; - } } static void @@ -284,7 +272,6 @@ 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_AUTH_RETRIES_UNSET; priv->s390_options = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free); } @@ -677,8 +664,7 @@ handle_auth_or_fail (NMDeviceEthernet *self, priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - if (!nm_device_auth_retries_try_next (NM_DEVICE (self), - &priv->auth_retries)) + if (!nm_device_auth_retries_try_next (NM_DEVICE (self))) return NM_ACT_STAGE_RETURN_FAILURE; nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); @@ -1343,9 +1329,6 @@ deactivate (NMDevice *device) NMSettingDcb *s_dcb; GError *error = NULL; - /* Clear wired secrets tries when deactivating */ - priv->auth_retries = NM_DEVICE_AUTH_RETRIES_UNSET; - nm_clear_g_source (&priv->pppoe_wait_id); if (priv->ppp_manager) { |