Upstream: service: Enable ipconfig only for the changed IP type 87/86387/1 accepted/tizen/common/20160907.154208 accepted/tizen/ivi/20160908.003638 accepted/tizen/mobile/20160908.003510 accepted/tizen/tv/20160908.003548 accepted/tizen/wearable/20160908.003612 submit/tizen/20160907.003226 submit/tizen/20160907.012754
authorSaurav Babu <saurav.babu@samsung.com>
Mon, 18 Jul 2016 11:13:53 +0000 (16:43 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Thu, 1 Sep 2016 03:19:41 +0000 (08:49 +0530)
When IPv6.Configuration is changed to "off" then connman starts fresh
DHCP Requests for service after changing its state to Configuration.
In an ideal scenario IPv4 Configurations should not be affected on
changing IPv6.Configuration property.
This patch only enables ipconfig for the changed IP type and leaves
other IP type unchanged

Change-Id: I65eacb6711314d2674e709711f432ef706167fc4
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/service.c

index f77f033..1eae380 100755 (executable)
@@ -4040,9 +4040,11 @@ static DBusMessage *set_property(DBusConnection *conn,
                if (err < 0) {
                        if (is_connected_state(service, state) ||
                                        is_connecting_state(service, state)) {
-                               __connman_network_enable_ipconfig(service->network,
+                               if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+                                       __connman_network_enable_ipconfig(service->network,
                                                        service->ipconfig_ipv4);
-                               __connman_network_enable_ipconfig(service->network,
+                               else
+                                       __connman_network_enable_ipconfig(service->network,
                                                        service->ipconfig_ipv6);
                        }
 
@@ -4055,10 +4057,12 @@ static DBusMessage *set_property(DBusConnection *conn,
                        ipv6_configuration_changed(service);
 
                if (is_connecting(service) || is_connected(service)) {
-                       __connman_network_enable_ipconfig(service->network,
-                                                       service->ipconfig_ipv4);
-                       __connman_network_enable_ipconfig(service->network,
-                                                       service->ipconfig_ipv6);
+                       if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+                               __connman_network_enable_ipconfig(service->network,
+                                                               service->ipconfig_ipv4);
+                       else
+                               __connman_network_enable_ipconfig(service->network,
+                                                               service->ipconfig_ipv6);
                }
 
                service_save(service);