From: Tomasz Bursztyka Date: Mon, 24 Sep 2012 12:04:26 +0000 (+0300) Subject: ipconfig: Fix IPv6.Configuration parsing X-Git-Tag: 1.8~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48987a5bb9c608b5189cd4c4ae19128c1f82b0ea;p=platform%2Fupstream%2Fconnman.git 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. --- 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) {