about summary refs log tree commit diff
path: root/src/nm-dhcp4-config.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-06-04 00:08:31 +0200
committerMichael Biebl <biebl@debian.org>2018-06-04 00:08:31 +0200
commit0dd9df69fdbd475c48a0c8d5b0a1882550fe7321 (patch)
tree249cf25643b1fe408e10679bb61613bc6540e894 /src/nm-dhcp4-config.c
parent2e94a3b93171ab3fb95bf689aab1664d23988809 (diff)
parent04bc9e1cd3544445d883ad29ea108c1645c8e7b7 (diff)
Update upstream source from tag 'upstream/1.11.4'
Update to upstream version '1.11.4'
with Debian dir d0638aa2e32d5bae4e8daa021b9a66b7c4d6647e
Diffstat (limited to 'src/nm-dhcp4-config.c')
-rw-r--r--src/nm-dhcp4-config.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/nm-dhcp4-config.c b/src/nm-dhcp4-config.c
index 08becf3c..ceafddf5 100644
--- a/src/nm-dhcp4-config.c
+++ b/src/nm-dhcp4-config.c
@@ -27,6 +27,7 @@
 #include "nm-dbus-interface.h"
 #include "nm-utils.h"
 #include "nm-dbus-object.h"
+#include "nm-core-utils.h"
 
 /*****************************************************************************/
 
@@ -58,22 +59,14 @@ nm_dhcp4_config_set_options (NMDhcp4Config *self,
                              GHashTable *options)
 {
 	NMDhcp4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (self);
-	GHashTableIter iter;
-	const char *key, *value;
-	GVariantBuilder builder;
+	GVariant *val;
 
 	g_return_if_fail (NM_IS_DHCP4_CONFIG (self));
-	g_return_if_fail (options != NULL);
+	g_return_if_fail (options);
 
+	val = nm_utils_strdict_to_variant (options);
 	g_variant_unref (priv->options);
-
-	g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
-	g_hash_table_iter_init (&iter, options);
-	while (g_hash_table_iter_next (&iter, (gpointer) &key, (gpointer) &value))
-		g_variant_builder_add (&builder, "{sv}", key, g_variant_new_string (value));
-
-	priv->options = g_variant_builder_end (&builder);
-	g_variant_ref_sink (priv->options);
+	priv->options = g_variant_ref_sink (val);
 	_notify (self, PROP_OPTIONS);
 }