summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-06-22 11:55:09 +0200
committerThomas Haller <thaller@redhat.com>2020-06-22 11:59:21 +0200
commit62263e706fb7e3ac9ab628af60e4f52faf67a2ea (patch)
tree19d7682b97a6a72d34694a2394db0ebfc10ee711
parentd69f057a65a63e7f62a1f2cea789c6367547202b (diff)
downloadNetworkManager-62263e706fb7e3ac9ab628af60e4f52faf67a2ea.tar.gz
libnm: return NULL for boxed strv properties of NMSettingMatch
The API does not allow to distinguish between an unset (NULL) or empty strv array. For example, nm_setting_match_get_paths() never returns %NULL, but returns an empty strv array. On the other hand, the GObject properties of type G_TYPE_STRV have a default value of %NULL. That means, also the getter should map both unset and empty to %NULL. Note that this is a change in behavior w.r.t. 1.24.0 API, where match.interface-name property would return an empty strv array. Regrading the other API, this is no change because it is new API and we will fix it before 1.26.0 release.
-rw-r--r--libnm-core/nm-setting-match.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libnm-core/nm-setting-match.c b/libnm-core/nm-setting-match.c
index 6071c88290..599fcf9916 100644
--- a/libnm-core/nm-setting-match.c
+++ b/libnm-core/nm-setting-match.c
@@ -659,16 +659,16 @@ get_property (GObject *object, guint prop_id,
switch (prop_id) {
case PROP_INTERFACE_NAME:
- g_value_set_boxed (value, nm_strvarray_get_strv (&self->interface_name, NULL));
+ g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->interface_name, NULL));
break;
case PROP_KERNEL_COMMAND_LINE:
- g_value_set_boxed (value, nm_strvarray_get_strv (&self->kernel_command_line, NULL));
+ g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->kernel_command_line, NULL));
break;
case PROP_DRIVER:
- g_value_set_boxed (value, nm_strvarray_get_strv (&self->driver, NULL));
+ g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->driver, NULL));
break;
case PROP_PATH:
- g_value_set_boxed (value, nm_strvarray_get_strv (&self->path, NULL));
+ g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->path, NULL));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);