From 595a06b689c93bd77796a93cb9a99de4a32cfb5b Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 4 Dec 2017 14:38:21 +0100 Subject: [PATCH] libnm-core/utils: allow use of bytestring with attributes (cherry picked from commit 18dd937b81bc683f3bb5fd7a35b0fc4bd0b09f12) --- libnm-core/nm-utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 0c559c42ca..cd4d9d6de9 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -5550,6 +5550,8 @@ nm_utils_parse_variant_attributes (const char *string, variant = g_variant_new_boolean (b); } else if (g_variant_type_equal ((*s)->type, G_VARIANT_TYPE_STRING)) { variant = g_variant_new_take_string (g_steal_pointer (&value)); + } else if (g_variant_type_equal ((*s)->type, G_VARIANT_TYPE_BYTESTRING)) { + variant = g_variant_new_bytestring (value); } else { g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_FAILED, _("unsupported attribute '%s' of type '%s'"), (*s)->name, @@ -5618,6 +5620,8 @@ nm_utils_format_variant_attributes (GHashTable *attributes, value = g_variant_get_boolean (variant) ? "true" : "false"; else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING)) value = g_variant_get_string (variant, NULL); + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_BYTESTRING)) + value = g_variant_get_bytestring (variant); else continue;