[PATCH 05/12] session: do not notify ipconfig content if it's not in a connected state

Tomasz Bursztyka tomasz.bursztyka at linux.intel.com
Wed Feb 15 00:19:43 PST 2012


---
 src/session.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/session.c b/src/session.c
index fbb53b8..69b3f7a 100644
--- a/src/session.c
+++ b/src/session.c
@@ -341,6 +341,11 @@ static void append_ipconfig_ipv4(DBusMessageIter *iter, void *user_data)
 	if (service == NULL)
 		return;
 
+	if (__connman_service_is_connected_state(service,
+				CONNMAN_IPCONFIG_TYPE_IPV4) == FALSE) {
+		return;
+	}
+
 	ipconfig_ipv4 = __connman_service_get_ip4config(service);
 	if (ipconfig_ipv4 == NULL)
 		return;
@@ -356,6 +361,11 @@ static void append_ipconfig_ipv6(DBusMessageIter *iter, void *user_data)
 	if (service == NULL)
 		return;
 
+	if (__connman_service_is_connected_state(service,
+				CONNMAN_IPCONFIG_TYPE_IPV6) == FALSE) {
+		return;
+	}
+
 	ipconfig_ipv4 = __connman_service_get_ip4config(service);
 	ipconfig_ipv6 = __connman_service_get_ip6config(service);
 	if (ipconfig_ipv6 == NULL)
-- 
1.7.8.4




More information about the connman mailing list