From 49c962e9c51a0bc3227520a3d87bfc1ca8e30e47 Mon Sep 17 00:00:00 2001 From: Sumit Aggarwal Date: Wed, 17 Aug 2016 16:41:25 +0530 Subject: [PATCH] Added vconf key for ipv6 address. Change-Id: I5345b514c164a7af7c7bb25a86b0469c3de55649 Signed-off-by: Sumit Aggarwal --- include/network-state.h | 1 + src/network-state.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/network-state.h b/include/network-state.h index cb892ee..8f2fed4 100755 --- a/include/network-state.h +++ b/include/network-state.h @@ -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); diff --git a/src/network-state.c b/src/network-state.c index 0e438fd..c97a336 100755 --- a/src/network-state.c +++ b/src/network-state.c @@ -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) -- 2.34.1