Load ipconfig setting from __connman_service_create_ipconfig()
authorMartin Xu <martin.xu@intel.com>
Tue, 13 Apr 2010 13:14:08 +0000 (15:14 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 13 Apr 2010 13:51:30 +0000 (15:51 +0200)
When creating a service without an ipconfig, the ipconfig settings are not
loaded. This issue is fixed by calling __connman_ipconfig_load() indirectly
from connman_network_set_index().

src/service.c

index e0e363e..9e1dc03 100644 (file)
@@ -2226,10 +2226,24 @@ static void setup_ipconfig(struct connman_service *service, int index)
 void __connman_service_create_ipconfig(struct connman_service *service,
                                                                int index)
 {
+       const char *ident = service->profile;
+       GKeyFile *keyfile;
+
        if (service->ipconfig != NULL)
                return;
 
        setup_ipconfig(service, index);
+
+       if (ident == NULL)
+               return;
+
+       keyfile = __connman_storage_open_profile(ident);
+       if (keyfile == NULL)
+               return;
+
+       __connman_ipconfig_load(service->ipconfig, keyfile,
+                                       service->identifier, "IPv4.");
+       g_key_file_free(keyfile);
 }
 
 /**