Added vconf key for ipv6 address. 28/84228/1
authorSumit Aggarwal <aggarwal.s@samsung.com>
Wed, 17 Aug 2016 11:11:25 +0000 (16:41 +0530)
committerSumit Aggarwal <aggarwal.s@samsung.com>
Wed, 17 Aug 2016 11:11:25 +0000 (16:41 +0530)
Change-Id: I5345b514c164a7af7c7bb25a86b0469c3de55649
Signed-off-by: Sumit Aggarwal <aggarwal.s@samsung.com>
include/network-state.h
src/network-state.c

index cb892ee1ec0d9747d7413894df02df0064622bbf..8f2fed4843ff95b7369822d83fc8f6a329f63d94 100755 (executable)
@@ -24,6 +24,7 @@
 extern "C" {
 #endif
 
+#define VCONFKEY_NETWORK_IP6               "memory/dnet/ip6"
 void netconfig_network_notify_ethernet_cable_state(const char *key);
 
 const char             *netconfig_get_default_profile(void);
index 0e438fde66c9c74010d72b409c8a6911d8ed923a..c97a336469921942fcb83cc8833eff710b76ea0d 100755 (executable)
@@ -430,7 +430,8 @@ static void __netconfig_update_default_connection_info(void)
        if (profile == NULL)
                DBG("Reset network state configuration");
        else
-               DBG("%s: ip(%s) proxy(%s)", profile, ip_addr, proxy_addr);
+               DBG("%s: ip(%s) ip6(%s) proxy(%s)", profile, ip_addr, ip_addr6,
+                   proxy_addr);
 
        netconfig_vconf_get_int(VCONFKEY_NETWORK_STATUS, &old_network_status);
 
@@ -438,6 +439,7 @@ static void __netconfig_update_default_connection_info(void)
                netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_OFF);
 
                netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "");
+               netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "");
                netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, "");
 
                netconfig_set_vconf_int(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, 0);
@@ -449,6 +451,7 @@ static void __netconfig_update_default_connection_info(void)
                netconfig_clatd_disable();
        } else if (profile != NULL) {
                char *old_ip = vconf_get_str(VCONFKEY_NETWORK_IP);
+               char *old_ip6 = vconf_get_str(VCONFKEY_NETWORK_IP6);
                char *old_proxy = vconf_get_str(VCONFKEY_NETWORK_PROXY);
 
                if (netconfig_is_wifi_profile(profile) == TRUE) {
@@ -489,12 +492,17 @@ static void __netconfig_update_default_connection_info(void)
                if (g_strcmp0(old_ip, ip_addr) != 0 || old_ip == NULL) {
                        if (ip_addr != NULL)
                                netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, ip_addr);
-                       else if (ip_addr6 != NULL)
-                               netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, ip_addr6);
                        else
                                netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "");
                }
+               if (g_strcmp0(old_ip6, ip_addr6) != 0) {
+                       if (ip_addr6 != NULL)
+                               netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ip_addr6);
+                       else
+                               netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "");
+               }
                g_free(old_ip);
+               g_free(old_ip6);
 
                if (g_strcmp0(old_proxy, proxy_addr) != 0) {
                        if (proxy_addr == NULL)