From d5d513243b7072d514e8ccca7fa322af1964cf5b Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Thu, 9 Mar 2017 14:30:17 +0900 Subject: [PATCH] Update vconf for IPv6 address Change-Id: I933ab794c03fe7f2b59ddf81d6b36245895f4edf Signed-off-by: Seonah Moon --- packaging/net-config.spec | 2 +- src/network-state.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packaging/net-config.spec b/packaging/net-config.spec index c5ca245..00717c1 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ Name: net-config Summary: TIZEN Network Configuration service -Version: 1.1.101 +Version: 1.1.102 Release: 2 Group: System/Network License: Apache-2.0 diff --git a/src/network-state.c b/src/network-state.c index 37706cc..1a6b775 100755 --- a/src/network-state.c +++ b/src/network-state.c @@ -457,7 +457,7 @@ 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); @@ -474,6 +474,7 @@ static void __netconfig_update_default_connection_info(void) } 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) { @@ -510,13 +511,19 @@ 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, ""); } g_free(old_ip); + if (g_strcmp0(old_ip6, ip_addr6) != 0 || old_ip6 == NULL) { + if (ip_addr6 != NULL) + netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ip_addr6); + else + netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ""); + } + g_free(old_ip6); + if (g_strcmp0(old_proxy, proxy_addr) != 0) { if (proxy_addr == NULL) netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, ""); -- 2.7.4