static gboolean __connection_cb_ip_changed_cb_idle(gpointer user_data)
{
char *ip_addr;
+ char *ip6_addr;
void *data;
connection_address_changed_cb callback;
connection_handle_s *local_handle = (connection_handle_s *)user_data;
CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
"vconf_get_str(VCONFKEY_NETWORK_IP) is Failed");
+ ip6_addr = vconf_get_str(VCONFKEY_NETWORK_IP6);
+ if (ip6_addr == NULL)
+ CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
+ "vconf_get_str(VCONFKEY_NETWORK_IP6) is Failed");
+
callback = __connection_get_ip_changed_callback(local_handle);
data = __connection_get_ip_changed_userdata(local_handle);
- /* TODO: IPv6 should be supported */
+
if (callback)
- callback(ip_addr, NULL, data);
+ callback(ip_addr, ip6_addr, data);
free(ip_addr);
+ free(ip6_addr);
return FALSE;
}
local_handle = (connection_handle_s *)connection;
if (callback) {
- if (refcount == 0)
+ if (refcount == 0) {
vconf_notify_key_changed(VCONFKEY_NETWORK_IP,
__connection_cb_ip_change_cb, NULL);
+ vconf_notify_key_changed(VCONFKEY_NETWORK_IP6,
+ __connection_cb_ip_change_cb, NULL);
+ }
refcount++;
CONNECTION_LOG(CONNECTION_INFO, "Successfully registered(%d)", refcount);
CONNECTION_LOG(CONNECTION_INFO,
"Successfully de-registered(%d)", refcount);
}
+ if (vconf_ignore_key_changed(VCONFKEY_NETWORK_IP6,
+ __connection_cb_ip_change_cb) < 0) {
+ CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
+ "Error to de-register vconf callback(%d)", refcount);
+ } else {
+ CONNECTION_LOG(CONNECTION_INFO,
+ "Successfully de-registered(%d)", refcount);
+ }
}
}
}