diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2014-10-16 18:09:17 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2014-10-16 18:15:29 +0200 |
commit | 29f51181bbc0bfa96eb9f096dee9db7ff0086561 (patch) | |
tree | 22f01d169b933c65e5681f09914dad96e9d36c87 | |
parent | 42f063cdc0ddb841c0fbb9dd36fb170a9894712b (diff) | |
download | NetworkManager-29f51181bbc0bfa96eb9f096dee9db7ff0086561.tar.gz |
cli: get connection ID straight from the active connectionjk/nmcli-connection-fixes
Static connection profile may not be available and using active conection
is easier anyway.
-rw-r--r-- | clients/cli/devices.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 903096d08f..4949691264 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -685,25 +685,13 @@ construct_header_name (const char *base, const char *spec) static const char * get_active_connection_id (NMDevice *device) { - const GPtrArray *avail_cons; NMActiveConnection *ac; - const char *ac_uuid; - int i; ac = nm_device_get_active_connection (device); if (!ac) return NULL; - ac_uuid = nm_active_connection_get_uuid (ac); - - avail_cons = nm_device_get_available_connections (device); - for (i = 0; i < avail_cons->len; i++) { - NMRemoteConnection *candidate = g_ptr_array_index (avail_cons, i); - const char *test_uuid = nm_connection_get_uuid (NM_CONNECTION (candidate)); - if (g_strcmp0 (ac_uuid, test_uuid) == 0) - return nm_connection_get_id (NM_CONNECTION (candidate)); - } - return NULL; + return nm_active_connection_get_id (ac); } static gboolean |