diff options
author | Thomas Haller <thaller@redhat.com> | 2018-03-14 08:53:32 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-03-18 21:09:56 +0100 |
commit | f761902d6d475f3613428b84a34fd15a480bb887 (patch) | |
tree | 19d25bdeb39f9f6dfffa4e216a5a2d61cce8c589 | |
parent | 7d23f8ba5bf0ee59bb6c6745f75ed1a6d8307db0 (diff) | |
download | NetworkManager-f761902d6d475f3613428b84a34fd15a480bb887.tar.gz |
core: don't sort connection list for nm_utils_complete_generic()
We create the all_connections list in impl_manager_add_and_activate_connection().
With this list we either call nm_utils_complete_generic() directly,
or pass it to nm_device_complete_connection(). The latter also ends
up only calling nm_utils_complete_generic() with this argument.
nm_utils_complete_generic() doesn't care about the order in which
the connections are returned. Which also becomes apparent, because
we first sorted the list, and then reverted the order with
g_slist_prepend().
Do not sort the list, hence we also don't need to clone it.
-rw-r--r-- | src/nm-manager.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c index 0b34ff44ab..c621c76e1a 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4555,12 +4555,10 @@ impl_manager_add_and_activate_connection (NMDBusObject *obj, goto error; { - gs_free NMSettingsConnection **connections = NULL; + NMSettingsConnection *const*connections; guint i, len; - connections = nm_settings_get_connections_clone (priv->settings, &len, - NULL, NULL, - nm_settings_connection_cmp_autoconnect_priority_p_with_data, NULL); + connections = nm_settings_get_connections (priv->settings, &len); all_connections = NULL; for (i = len; i > 0; ) { i--; |