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

Tomasz Bursztyka tomasz.bursztyka at linux.intel.com
Fri Feb 3 02:39:01 PST 2012


---
 src/session.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/session.c b/src/session.c
index f1186a0..6710906 100644
--- a/src/session.c
+++ b/src/session.c
@@ -383,17 +383,25 @@ static void append_notify(DBusMessageIter *dict,
 
 	if ((session->append_all == TRUE || info->entry != info_last->entry) &&
 			info->entry != NULL) {
+		struct connman_service *service = info->entry->service;
+
 		connman_dbus_dict_append_basic(dict, "Name",
 						DBUS_TYPE_STRING,
 						&info->entry->name);
 
-		connman_dbus_dict_append_dict(dict, "IPv4",
+		if (__connman_service_is_connected_state(service,
+					CONNMAN_IPCONFIG_TYPE_IPV4) == TRUE) {
+			connman_dbus_dict_append_dict(dict, "IPv4",
 						append_ipconfig_ipv4,
-						info->entry->service);
+						service);
+		}
 
-		connman_dbus_dict_append_dict(dict, "IPv6",
+		if (__connman_service_is_connected_state(service,
+					CONNMAN_IPCONFIG_TYPE_IPV6) == TRUE) {
+			connman_dbus_dict_append_dict(dict, "IPv6",
 						append_ipconfig_ipv6,
-						info->entry->service);
+						service);
+		}
 
 		connman_dbus_dict_append_basic(dict, "Interface",
 						DBUS_TYPE_STRING,
-- 
1.7.8.4




More information about the connman mailing list