mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 09:30:13 +01:00
core: ensure newly-created master interfaces are ready for activation
Reverts part of
2226a00cc2
core: add a "default-unmanaged" setting for devices
Newly-created master interfaces are in the UNAVAILABLE state, but if
they were created in response to a slave connection being activated,
the master must be activated immediately too. But a device cannot
be activated unless it's in the DISCONNECTED state, so restore that
state change.
This commit is contained in:
parent
4ca885f5e3
commit
8bab0c8203
1 changed files with 12 additions and 0 deletions
|
|
@ -2858,6 +2858,18 @@ nm_manager_activate_connection (NMManager *manager,
|
|||
"Failed to create virtual interface");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* A newly created device, if allowed to be managed by NM, will be
|
||||
* in the UNAVAILABLE state here. To ensure it can be activated
|
||||
* immediately, we transition it to DISCONNECTED so it passes the
|
||||
* nm_device_can_activate() check below.
|
||||
*/
|
||||
if ( nm_device_is_available (device)
|
||||
&& (nm_device_get_state (device) == NM_DEVICE_STATE_UNAVAILABLE)) {
|
||||
nm_device_state_changed (device,
|
||||
NM_DEVICE_STATE_DISCONNECTED,
|
||||
NM_DEVICE_STATE_REASON_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue