service: Only send correct ipconfig changed signal
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Mon, 25 Mar 2013 10:32:42 +0000 (12:32 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 25 Mar 2013 12:08:48 +0000 (14:08 +0200)
If we are changing IPv4 config, then send only IPv4 changed signal
and not the IPv6 one. Same is done for IPv6 config when it changes.

src/service.c

index e0bf409baa95b6329cce6ff1dedbd3a56b3918b0..e93b708bfd7592ffe39e9c1467750e827643aef1 100644 (file)
@@ -1757,16 +1757,21 @@ static void append_provider(DBusMessageIter *iter, void *user_data)
 static void settings_changed(struct connman_service *service,
                                struct connman_ipconfig *ipconfig)
 {
+       enum connman_ipconfig_type type;
+
        if (allow_property_changed(service) == FALSE)
                return;
 
-       connman_dbus_property_changed_dict(service->path,
-                                       CONNMAN_SERVICE_INTERFACE, "IPv4",
-                                                       append_ipv4, service);
+       type = __connman_ipconfig_get_config_type(ipconfig);
 
-       connman_dbus_property_changed_dict(service->path,
+       if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+               connman_dbus_property_changed_dict(service->path,
+                                       CONNMAN_SERVICE_INTERFACE, "IPv4",
+                                       append_ipv4, service);
+       else if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
+               connman_dbus_property_changed_dict(service->path,
                                        CONNMAN_SERVICE_INTERFACE, "IPv6",
-                                                       append_ipv6, service);
+                                       append_ipv6, service);
 
        __connman_notifier_ipconfig_changed(service, ipconfig);
 }