summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-04-19 13:28:38 +0200
committerThomas Haller <thaller@redhat.com>2018-04-30 16:36:29 +0200
commit9c2785f31c333b94f66484acf040e9f1b2d9e6a5 (patch)
tree1d8b8d8476ffc846b88efc4c5d075fb8610fb33e
parent5a1f84b085835742e715a05b4e5e65e518a47c42 (diff)
downloadNetworkManager-9c2785f31c333b94f66484acf040e9f1b2d9e6a5.tar.gz
core: only abort conflicting activations for certain activation types
There are various places where we do an internal activation (with an internal auth-subject). In several of these places, the ACTIVATION_REASON is USER_REQUEST. I think it is wrong to generally abort all internal activations, except AUTOCONNECT_SLAVES ones. I think, aborting an activation should be opt-in instead of opt-out. To me it seems, we want to abort the activation based on the activation reason. For now, opt-in to EXTERNAL, ASSUME and AUTOCONNECT only. If there are additional cases where we should abort activation, we should add yet another reason and not use USER_REQUEST.
-rw-r--r--src/nm-manager.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 25ba1c278a..63064b5776 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -4251,14 +4251,14 @@ _internal_activation_auth_done (NMManager *self,
if (!success)
goto fail;
- /* Don't continue with an internal activation if an equivalent active
- * connection already exists. Note that slave autoconnections always force a
- * reconnection. We also check this earlier, but there we may fail to
- * detect a duplicate if the existing active connection is undergoing
- * authorization in impl_manager_activate_connection().
+ /* Don't continue with an autoconnect-activation if a more important activation
+ * already exists.
+ * We also check this earlier, but there we may fail to detect a duplicate
+ * if the existing active connection was undergoing authorization.
*/
- if ( nm_auth_subject_is_internal (nm_active_connection_get_subject (active))
- && nm_active_connection_get_activation_reason (active) != NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES) {
+ if (NM_IN_SET (nm_active_connection_get_activation_reason (active), NM_ACTIVATION_REASON_EXTERNAL,
+ NM_ACTIVATION_REASON_ASSUME,
+ NM_ACTIVATION_REASON_AUTOCONNECT)) {
c_list_for_each_entry (ac, &priv->active_connections_lst_head, active_connections_lst) {
if ( nm_active_connection_get_device (ac) == nm_active_connection_get_device (active)
&& nm_active_connection_get_settings_connection (ac) == nm_active_connection_get_settings_connection (active)