diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-09-24 15:04:26 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-09-28 09:39:22 +0300 |
commit | 48987a5bb9c608b5189cd4c4ae19128c1f82b0ea (patch) | |
tree | 1285be64a507eb426566c3a40014c5a97fa119de /src/ipconfig.c | |
parent | 2bde019f7aa798930a840207e63a3f9b19a71cb1 (diff) | |
download | connman-48987a5bb9c608b5189cd4c4ae19128c1f82b0ea.tar.gz connman-48987a5bb9c608b5189cd4c4ae19128c1f82b0ea.tar.bz2 connman-48987a5bb9c608b5189cd4c4ae19128c1f82b0ea.zip |
ipconfig: Fix IPv6.Configuration parsing
PrefixLength is exposed as a byte in the API, but code was
waiting for a string when setting a new value.
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r-- | src/ipconfig.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c index 0c88fa53..3de30cdb 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -2095,7 +2095,7 @@ int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig, { enum connman_ipconfig_method method = CONNMAN_IPCONFIG_METHOD_UNKNOWN; const char *address = NULL, *netmask = NULL, *gateway = NULL, - *prefix_length_string = NULL, *privacy_string = NULL; + *privacy_string = NULL; int prefix_length = 0, privacy = 0; DBusMessageIter dict; @@ -2140,13 +2140,11 @@ int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig, dbus_message_iter_get_basic(&value, &address); } else if (g_str_equal(key, "PrefixLength") == TRUE) { - if (type != DBUS_TYPE_STRING) + if (type != DBUS_TYPE_BYTE) return -EINVAL; - dbus_message_iter_get_basic(&value, - &prefix_length_string); + dbus_message_iter_get_basic(&value, &prefix_length); - prefix_length = atoi(prefix_length_string); if (prefix_length < 0 || prefix_length > 128) return -EINVAL; } else if (g_str_equal(key, "Netmask") == TRUE) { |