diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-03-15 16:22:55 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-03-15 16:45:49 +0100 |
commit | b278b2cd72ca176af2c4d56c65508ef3c862013c (patch) | |
tree | c3dd5bb1e17acfd11bd2783bc7a88930a673edf1 | |
parent | 4987ec408a2e800de2278cd74e9f012dc69b8ed3 (diff) |
device: ethernet: fix handling of autoconnect retries for non-802.1x
Commit 4a6fd0e83ec0 ("device: honor the connection.autoconnect-retries
for 802.1X") added a reset of the autoconnect retries when the device
changes state, because the retry logic for 802.1x is implemented in
NMDeviceEthernet. For other connections, we should not reset the
retries as NMPolicy handles them.
Fixes: 4a6fd0e83ec0d83547b1f3a1a916f85e9f450d8c
-rw-r--r-- | src/devices/nm-device-ethernet.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 55867516f..9b39e2ad1 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -256,13 +256,14 @@ _update_s390_subchannels (NMDeviceEthernet *self) } static void -reset_autoconnect_retries (NMDevice *device) +reset_8021x_autoconnect_retries (NMDevice *device) { NMActRequest *req; NMSettingsConnection *connection; req = nm_device_get_act_request (device); - if (req) { + if ( req + && nm_device_get_applied_setting (device, NM_TYPE_SETTING_802_1X)) { connection = nm_act_request_get_settings_connection (req); g_return_if_fail (connection); /* Reset autoconnect retries on success, failure, or when deactivating */ @@ -279,10 +280,11 @@ device_state_changed (NMDevice *device, if (new_state > NM_DEVICE_STATE_ACTIVATED) wired_secrets_cancel (NM_DEVICE_ETHERNET (device)); - if ( new_state == NM_DEVICE_STATE_ACTIVATED - || new_state == NM_DEVICE_STATE_FAILED - || new_state == NM_DEVICE_STATE_DISCONNECTED) - reset_autoconnect_retries (device); + if (NM_IN_SET (new_state, + NM_DEVICE_STATE_ACTIVATED, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_DISCONNECTED)) + reset_8021x_autoconnect_retries (device); } static void @@ -1367,7 +1369,7 @@ deactivate (NMDevice *device) GError *error = NULL; /* Clear wired secrets tries when deactivating */ - reset_autoconnect_retries (device); + reset_8021x_autoconnect_retries (device); nm_clear_g_source (&priv->pppoe_wait_id); |