summaryrefslogtreecommitdiff
path: root/src/connection.c
diff options
context:
space:
mode:
authorhyunuktak <hyunuk.tak@samsung.com>2015-08-07 17:11:34 +0900
committerhyunuktak <hyunuk.tak@samsung.com>2015-08-07 17:11:56 +0900
commit6aa4055ef0544ae85457c25c510fe3db04949c43 (patch)
tree94018be3cef92c33b60650c488dc15536c8f978a /src/connection.c
parentbc55a3df0d4d2d97964ce2fadc9fe3ffc4953f4e (diff)
downloadconnman-6aa4055ef0544ae85457c25c510fe3db04949c43.tar.gz
connman-6aa4055ef0544ae85457c25c510fe3db04949c43.tar.bz2
connman-6aa4055ef0544ae85457c25c510fe3db04949c43.zip
Base Code merged to SPIN 2.4submit/tizen/20150810.034432
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com> Change-Id: I84a42375b5c59739e4caca1f726699ea7647ef17
Diffstat (limited to 'src/connection.c')
-rwxr-xr-x[-rw-r--r--]src/connection.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/connection.c b/src/connection.c
index 8fe97258..aa4e1c05 100644..100755
--- a/src/connection.c
+++ b/src/connection.c
@@ -401,13 +401,9 @@ static struct gateway_data *add_gateway(struct connman_service *service,
data->ipv4_gateway = old->ipv4_gateway;
old->ipv4_gateway = NULL;
}
- } else {
- /*
- * Only take a ref if we are adding new stuff to hash.
- */
- connman_service_ref(service);
}
+ connman_service_ref(data->service);
g_hash_table_replace(gateway_hash, service, data);
return data;
@@ -708,6 +704,8 @@ static void remove_gateway(gpointer user_data)
g_free(data->ipv6_gateway);
}
+ connman_service_unref(data->service);
+
g_free(data);
}
@@ -999,9 +997,7 @@ void __connman_connection_gateway_remove(struct connman_service *service,
(data->ipv4_gateway && !data->ipv6_gateway
&& do_ipv4) ||
(data->ipv6_gateway && !data->ipv4_gateway
- && do_ipv6)
- ) {
- connman_service_unref(service);
+ && do_ipv6)) {
g_hash_table_remove(gateway_hash, service);
} else
DBG("Not yet removing gw ipv4 %p/%d ipv6 %p/%d",