Hi Jukka

> could you check if attached patch helps the situation?
No the patch does not seem to fix the problem.

The attached patch does so im am wondering why this check is there in the first 
place?

Best regards
Tim
From 2ef8e35eeb51925ba433625ead5c8a875e166e65 Mon Sep 17 00:00:00 2001
From: Tim Sander <tim.san...@hbm.com>
Date: Tue, 14 Feb 2012 16:36:19 +0100
Subject: [PATCH] __connman_ipconfig_set_config accept variant

---
 src/ipconfig.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/src/ipconfig.c b/src/ipconfig.c
index f817699..62a8d0c 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -2029,17 +2029,35 @@ int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig,
 		if (g_str_equal(key, "Method") == TRUE) {
 			const char *str;
 
+			if (type == DBUS_TYPE_VARIANT) {
+				DBusMessageIter variant=entry;
+				dbus_message_iter_recurse(&variant,&entry);
+				type = dbus_message_iter_get_arg_type(&entry);
+			}
+
 			if (type != DBUS_TYPE_STRING)
 				return -EINVAL;
 
 			dbus_message_iter_get_basic(&entry, &str);
 			method = __connman_ipconfig_string2method(str);
 		} else if (g_str_equal(key, "Address") == TRUE) {
+			if (type == DBUS_TYPE_VARIANT) {
+				DBusMessageIter variant=entry;
+				dbus_message_iter_recurse(&variant,&entry);
+				type = dbus_message_iter_get_arg_type(&entry);
+			}
+
 			if (type != DBUS_TYPE_STRING)
 				return -EINVAL;
 
 			dbus_message_iter_get_basic(&entry, &address);
 		} else if (g_str_equal(key, "PrefixLength") == TRUE) {
+			if (type == DBUS_TYPE_VARIANT) {
+				DBusMessageIter variant=entry;
+				dbus_message_iter_recurse(&variant,&entry);
+				type = dbus_message_iter_get_arg_type(&entry);
+			}
+
 			if (type != DBUS_TYPE_STRING)
 				return -EINVAL;
 
@@ -2051,16 +2069,34 @@ int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig,
 				return -EINVAL;
 
 		} else if (g_str_equal(key, "Netmask") == TRUE) {
+			if (type == DBUS_TYPE_VARIANT) {
+				DBusMessageIter variant=entry;
+				dbus_message_iter_recurse(&variant,&entry);
+				type = dbus_message_iter_get_arg_type(&entry);
+			}
+
 			if (type != DBUS_TYPE_STRING)
 				return -EINVAL;
 
 			dbus_message_iter_get_basic(&entry, &netmask);
 		} else if (g_str_equal(key, "Gateway") == TRUE) {
+			if (type == DBUS_TYPE_VARIANT) {
+				DBusMessageIter variant=entry;
+				dbus_message_iter_recurse(&variant,&entry);
+				type = dbus_message_iter_get_arg_type(&entry);
+			}
+
 			if (type != DBUS_TYPE_STRING)
 				return -EINVAL;
 
 			dbus_message_iter_get_basic(&entry, &gateway);
 		} else if (g_str_equal(key, "Privacy") == TRUE) {
+			if (type == DBUS_TYPE_VARIANT) {
+				DBusMessageIter variant=entry;
+				dbus_message_iter_recurse(&variant,&entry);
+				type = dbus_message_iter_get_arg_type(&entry);
+			}
+
 			if (type != DBUS_TYPE_STRING)
 				return -EINVAL;
 
-- 
1.7.0.4

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to