mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 09:10:10 +01:00
device: ethernet: fix handling of autoconnect retries for non-802.1x
Commit4a6fd0e83e("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:4a6fd0e83e
This commit is contained in:
parent
4987ec408a
commit
b278b2cd72
1 changed files with 9 additions and 7 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue