summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-08-12 18:29:10 +0200
committerThomas Haller <thaller@redhat.com>2015-09-02 09:47:28 +0200
commit39a8792830c51eef96b0ec2b2d7349e2a05fcb56 (patch)
tree1807855738e40f10f6dec1f68eb324c2b382d618
parentec2bac958c52b850d8006d6703f9034a368eca3d (diff)
downloadNetworkManager-39a8792830c51eef96b0ec2b2d7349e2a05fcb56.tar.gz
core/manager: use active_connection_get_by_path() in impl_manager_deactivate_connection()
-rw-r--r--src/nm-manager.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 71b9d7074f..df25a086f4 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -3513,22 +3513,17 @@ impl_manager_deactivate_connection (NMManager *self,
const char *active_path)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+ NMActiveConnection *ac;
NMConnection *connection = NULL;
GError *error = NULL;
NMAuthSubject *subject = NULL;
- GSList *iter;
NMAuthChain *chain;
char *error_desc = NULL;
/* Find the connection by its object path */
- for (iter = priv->active_connections; iter; iter = g_slist_next (iter)) {
- NMActiveConnection *ac = iter->data;
-
- if (g_strcmp0 (nm_exported_object_get_path (NM_EXPORTED_OBJECT (ac)), active_path) == 0) {
- connection = nm_active_connection_get_connection (ac);
- break;
- }
- }
+ ac = active_connection_get_by_path (self, active_path);
+ if (ac)
+ connection = nm_active_connection_get_connection (ac);
if (!connection) {
error = g_error_new_literal (NM_MANAGER_ERROR,