From 48987a5bb9c608b5189cd4c4ae19128c1f82b0ea Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Mon, 24 Sep 2012 15:04:26 +0300 Subject: [PATCH] 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. --- src/ipconfig.c | 8 +++----- 1 file 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) { -- 2.34.1