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-18 16:12:36 +0200
commit6006a0b134296526e5bdd35b8aeba177b60461ad (patch)
tree5a3dfc6ec8351c5193ec7c1dbbcf3ba639d919c4
parent31deca015710348de66ff3b288e961f912f34c27 (diff)
downloadNetworkManager-6006a0b134296526e5bdd35b8aeba177b60461ad.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 b56345eb63..c7c9860091 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -3521,22 +3521,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,