diff --git a/NEWS b/NEWS index 68785b2786..dbc01764ef 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ with the later release. USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE! * Added support for IEEE 802.15.4 and 6LowPAN devices. +* Support activating profile multiple times via connection.multi-connect + setting. The following changes were backported to 1.12.x releases between 1.12.0 and 1.12.2 are also present in NetworkManager-1.14: diff --git a/src/nm-manager.c b/src/nm-manager.c index 44dccca01b..6229a8857e 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2485,6 +2485,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) @@ -4116,6 +4117,7 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError * NMActiveConnection *master_ac = NULL; NMAuthSubject *subject; GError *local = NULL; + NMConnectionMultiConnect multi_connect; g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (active), FALSE); @@ -4276,7 +4278,15 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError * /* Check slaves for master connection and possibly activate them */ autoconnect_slaves (self, connection, device, nm_active_connection_get_subject (active)); - { + multi_connect = _nm_connection_get_multi_connect (NM_CONNECTION (connection)); + if ( multi_connect == NM_CONNECTION_MULTI_CONNECT_MULTIPLE + || ( multi_connect == NM_CONNECTION_MULTI_CONNECT_MANUAL_MULTIPLE + && NM_IN_SET (nm_active_connection_get_activation_reason (active), + NM_ACTIVATION_REASON_ASSUME, + NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES, + NM_ACTIVATION_REASON_USER_REQUEST))) { + /* the profile can be activated multiple times. Proceed. */ + } else { gs_unref_ptrarray GPtrArray *all_ac_arr = NULL; NMActiveConnection *ac; guint i, n_all; diff --git a/src/nm-policy.c b/src/nm-policy.c index 86bfba7afc..0dc4d80e22 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1235,7 +1235,7 @@ auto_activate_device (NMPolicy *self, if (!nm_device_autoconnect_allowed (device)) return; - connections = nm_manager_get_activatable_connections (priv->manager, FALSE, TRUE, &len); + connections = nm_manager_get_activatable_connections (priv->manager, TRUE, TRUE, &len); if (!connections[0]) return;