mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 01:00:09 +01:00
manager: update the device state file upon (dis)connection
Update the device state file every time the device is connected, disconnected, or becomes unmanaged. In this way, NM becomes more robust against crashes or forced terminations because it can resume the previous device state seamlessly.
This commit is contained in:
parent
060f2138ee
commit
8bbe61206f
1 changed files with 6 additions and 0 deletions
|
|
@ -1471,6 +1471,12 @@ manager_device_state_changed (NMDevice *device,
|
|||
break;
|
||||
}
|
||||
|
||||
if (NM_IN_SET (new_state,
|
||||
NM_DEVICE_STATE_UNMANAGED,
|
||||
NM_DEVICE_STATE_DISCONNECTED,
|
||||
NM_DEVICE_STATE_ACTIVATED))
|
||||
nm_manager_write_device_state (self, device);
|
||||
|
||||
if ( new_state == NM_DEVICE_STATE_UNAVAILABLE
|
||||
|| new_state == NM_DEVICE_STATE_DISCONNECTED)
|
||||
nm_settings_device_added (priv->settings, device);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue