From: Daniel Wagner Date: Fri, 10 Aug 2012 09:59:00 +0000 (+0200) Subject: network: Only set index in connman_network_set_index() X-Git-Tag: 1.5~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=3cb2ba35877c600e0a73d8d821f055e0a1f7973c;p=platform%2Fupstream%2Fconnman.git network: Only set index in connman_network_set_index() Service ipconfig structures are no longer created in this function. --- diff --git a/src/network.c b/src/network.c index e72e35f..20e3ebc 100644 --- a/src/network.c +++ b/src/network.c @@ -469,31 +469,14 @@ void connman_network_set_index(struct connman_network *network, int index) goto done; ipconfig = __connman_service_get_ip4config(service); + if (ipconfig == NULL) + goto done; + + /* If index changed, the index of ipconfig must be reset. */ + __connman_ipconfig_set_index(ipconfig, index); DBG("index %d service %p ip4config %p", network->index, service, ipconfig); - - if (network->index < 0 && ipconfig == NULL) { - - ipconfig = __connman_service_get_ip4config(service); - if (ipconfig == NULL) - /* - * This is needed for plugins that havent set their - * ipconfig layer yet, due to not being able to get - * a network index prior to creating a service. - */ - connman_service_create_ip4config(service, index); - else - __connman_ipconfig_set_index(ipconfig, index); - - } else { - /* If index changed, the index of ipconfig must be reset. */ - if (ipconfig == NULL) - goto done; - - __connman_ipconfig_set_index(ipconfig, index); - } - done: network->index = index; }