mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 21:40:08 +01:00
manager: fix assuming multi-connect connections
When assuming existing connections, allow the same connection to be activated on a different device if the connection is multi-connect capable. Otherwise, when a connection is active on multiple devices and NM is restarted, we assume only the first instance, and create in-memory connections for others.
This commit is contained in:
parent
16389f1037
commit
ffb4e36fee
1 changed files with 15 additions and 4 deletions
|
|
@ -2398,6 +2398,20 @@ done:
|
|||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
new_activation_allowed_for_connection (NMManager *self,
|
||||
NMSettingsConnection *connection)
|
||||
{
|
||||
if (NM_IN_SET (_nm_connection_get_multi_connect (NM_CONNECTION (connection)),
|
||||
NM_CONNECTION_MULTI_CONNECT_MANUAL_MULTIPLE,
|
||||
NM_CONNECTION_MULTI_CONNECT_MULTIPLE))
|
||||
return TRUE;
|
||||
|
||||
return !active_connection_find (self, connection, NULL,
|
||||
NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* get_existing_connection:
|
||||
* @manager: #NMManager instance
|
||||
|
|
@ -2485,10 +2499,7 @@ get_existing_connection (NMManager *self,
|
|||
*/
|
||||
if ( assume_state_connection_uuid
|
||||
&& (connection_checked = nm_settings_get_connection_by_uuid (priv->settings, assume_state_connection_uuid))
|
||||
/*XXX: consider connection multi_connect. */
|
||||
&& !active_connection_find (self, connection_checked, NULL,
|
||||
NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
|
||||
NULL)
|
||||
&& new_activation_allowed_for_connection (self, connection_checked)
|
||||
&& nm_device_check_connection_compatible (device, NM_CONNECTION (connection_checked), NULL)) {
|
||||
|
||||
if (connection) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue