Just update the service if it already exists
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 2 Jul 2009 14:52:22 +0000 (07:52 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 2 Jul 2009 14:52:22 +0000 (07:52 -0700)
src/service.c

index ab73772..bc25d8f 100644 (file)
@@ -1285,9 +1285,10 @@ struct connman_service *__connman_service_create_from_network(struct connman_net
        const char *ident, *group;
        char *name;
 
-       if (__connman_service_lookup_from_network(network) != NULL) {
-               connman_error("Service already exists");
-               return NULL;
+       service = __connman_service_lookup_from_network(network);
+       if (service != NULL) {
+               update_from_network(service, network);
+               return service;
        }
 
        ident = __connman_network_get_ident(network);