summaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-01-10 16:20:20 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-01-10 16:21:19 +0100
commit62abee221092e6176fafc0d5b8876f377741c6d0 (patch)
tree19884c8b67c4b2ae02cc3dc999f07bc92eff00f6 /src/service.c
parent48de4396d54100e9b91cf84b903a72af1d3c9dc3 (diff)
downloadconnman-62abee221092e6176fafc0d5b8876f377741c6d0.tar.gz
connman-62abee221092e6176fafc0d5b8876f377741c6d0.tar.bz2
connman-62abee221092e6176fafc0d5b8876f377741c6d0.zip
service: Do not unref ipconf layer upon disconnection
The ipconfig layer is referenced at service creation time and should thus be unreferenced when freeing said service.
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/src/service.c b/src/service.c
index 4572e59d..ef2817f0 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2228,15 +2228,8 @@ static gboolean connect_timeout(gpointer user_data)
if (service->network != NULL)
__connman_network_disconnect(service->network);
- if (__connman_ipconfig_disable(service->ipconfig_ipv4) == 0) {
- connman_ipconfig_unref(service->ipconfig_ipv4);
- service->ipconfig_ipv4 = NULL;
- }
-
- if (__connman_ipconfig_disable(service->ipconfig_ipv6) == 0) {
- connman_ipconfig_unref(service->ipconfig_ipv6);
- service->ipconfig_ipv6 = NULL;
- }
+ __connman_ipconfig_disable(service->ipconfig_ipv4);
+ __connman_ipconfig_disable(service->ipconfig_ipv6);
__connman_stats_service_unregister(service);
@@ -3349,17 +3342,8 @@ int __connman_service_connect(struct connman_service *service)
if (err < 0) {
if (err != -EINPROGRESS) {
- if (__connman_ipconfig_disable(
- service->ipconfig_ipv4) == 0) {
- connman_ipconfig_unref(service->ipconfig_ipv4);
- service->ipconfig_ipv4 = NULL;
- }
-
- if (__connman_ipconfig_disable(
- service->ipconfig_ipv6) == 0) {
- connman_ipconfig_unref(service->ipconfig_ipv6);
- service->ipconfig_ipv6 = NULL;
- }
+ __connman_ipconfig_disable(service->ipconfig_ipv4);
+ __connman_ipconfig_disable(service->ipconfig_ipv6);
__connman_stats_service_unregister(service);
if (service->userconnect == TRUE)
@@ -3406,15 +3390,8 @@ int __connman_service_disconnect(struct connman_service *service)
__connman_ipconfig_clear_address(service->ipconfig_ipv4);
__connman_ipconfig_clear_address(service->ipconfig_ipv6);
- if (__connman_ipconfig_disable(service->ipconfig_ipv4) == 0) {
- connman_ipconfig_unref(service->ipconfig_ipv4);
- service->ipconfig_ipv4 = NULL;
- }
-
- if (__connman_ipconfig_disable(service->ipconfig_ipv6) == 0) {
- connman_ipconfig_unref(service->ipconfig_ipv6);
- service->ipconfig_ipv6 = NULL;
- }
+ __connman_ipconfig_disable(service->ipconfig_ipv4);
+ __connman_ipconfig_disable(service->ipconfig_ipv6);
__connman_stats_service_unregister(service);