diff options
author | Tim Sander <tim01@iss.tu-darmstadt.de> | 2012-03-01 13:35:32 +0100 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-03-01 13:45:25 +0100 |
commit | 5defd54f15f003e672fd230d3d0fade1d4add20a (patch) | |
tree | 9d079488ddc2a6e1c046e96cb3452883cdc3c426 /src/ipconfig.c | |
parent | c1232db37c71d66a5ffd12f64fa193eec1fa8741 (diff) | |
download | connman-5defd54f15f003e672fd230d3d0fade1d4add20a.tar.gz connman-5defd54f15f003e672fd230d3d0fade1d4add20a.tar.bz2 connman-5defd54f15f003e672fd230d3d0fade1d4add20a.zip |
ipconfig: Accept variant types in __connman_ipconfig_set_config()
According the D-Bus API, the Service interface accepts
variant types.
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r-- | src/ipconfig.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c index e782fb1b..802fbefb 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -2032,17 +2032,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; @@ -2054,16 +2072,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; |