summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-08-10 11:59:00 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-14 09:01:41 +0300
commit3cb2ba35877c600e0a73d8d821f055e0a1f7973c (patch)
treeb6d42ff341c11c1edbad443cb943531782a226b5
parent152171411d7d9891e1ff6b5683a2e624ea2340cd (diff)
downloadconnman-3cb2ba35877c600e0a73d8d821f055e0a1f7973c.tar.gz
connman-3cb2ba35877c600e0a73d8d821f055e0a1f7973c.tar.bz2
connman-3cb2ba35877c600e0a73d8d821f055e0a1f7973c.zip
network: Only set index in connman_network_set_index()
Service ipconfig structures are no longer created in this function.
-rw-r--r--src/network.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/src/network.c b/src/network.c
index e72e35f9..20e3ebcd 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;
}