provider: Properly set host and domain provider members
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 1 Jul 2011 08:01:08 +0000 (11:01 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 6 Jul 2011 09:23:05 +0000 (11:23 +0200)
Detect 'Host' and 'VPN.Domain' strings being set and insert them
properly into the provider structure. Also ensure that the
strings corresponding to provider structure members are not
duplicated into the provider string settings hash.

src/provider.c

index 5bc8c40..39b9a9b 100644 (file)
@@ -623,9 +623,14 @@ int connman_provider_set_string(struct connman_provider *provider,
        } else if (g_str_equal(key, "Name") == TRUE) {
                g_free(provider->name);
                provider->name = g_strdup(value);
-       }
-
-       g_hash_table_replace(provider->setting_strings,
+       } else if (g_str_equal(key, "Host") == TRUE) {
+               g_free(provider->host);
+               provider->host = g_strdup(value);
+       } else if (g_str_equal(key, "VPN.Domain") == TRUE) {
+               g_free(provider->domain);
+               provider->domain = g_strdup(value);
+       } else
+               g_hash_table_replace(provider->setting_strings,
                                g_strdup(key), g_strdup(value));
        return 0;
 }