From a37c1d1e17e3161b61f51816018ad10af1fa569b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 17 Mar 2016 10:37:42 +0100 Subject: libnm: don't normalize connection for nm_device_get_applied_connection() Normalizing means that we fail on invalid connections. Which can happen when the server is newer than the libnm version. We just want to return whatever we can. The caller should make sense of this. This makes libnm more accepting and thus is not going to break existing applications. Also, nm_device_get_applied_connection() is new API since nm-1-1. --- libnm/nm-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libnm/nm-device.c') diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 81077bee4d..5679fd5f3d 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -2355,7 +2355,7 @@ nm_device_get_applied_connection (NMDevice *device, return NULL; } - connection = nm_simple_connection_new_from_dbus (dict, error); + connection = _nm_simple_connection_new_from_dbus (dict, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, error); if (!connection) return NULL; @@ -2397,7 +2397,7 @@ device_get_applied_connection_cb (GObject *proxy, goto out; } - connection = nm_simple_connection_new_from_dbus (dict, &error); + connection = _nm_simple_connection_new_from_dbus (dict, NM_SETTING_PARSE_FLAGS_BEST_EFFORT, &error); if (!connection) { g_simple_async_result_take_error (simple, error); goto out; -- cgit v1.2.1 From 52bd08de051e811c8b0aea354ae448e4647dfd0d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 23 Mar 2016 17:36:28 +0100 Subject: libnm: add code comments to hint that NMConnection might not validate --- libnm/nm-device.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libnm/nm-device.c') diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 5679fd5f3d..496dd87a06 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -2329,6 +2329,9 @@ nm_device_reapply_finish (NMDevice *device, * Returns: (transfer full): a %NMConnection with the currently applied settings * or %NULL on error. * + * The connection is as received from D-Bus and might not validate according + * to nm_connection_verify(). + * * Since: 1.2 **/ NMConnection * @@ -2457,6 +2460,9 @@ nm_device_get_applied_connection_async (NMDevice *device, * Returns: (transfer full): a currently applied %NMConnection or %NULL in case * of error. * + * The connection is as received from D-Bus and might not validate according + * to nm_connection_verify(). + * * Since: 1.2 **/ NMConnection * -- cgit v1.2.1