+ option = g_dhcp_client_get_option(dhcp_client, G_DHCP_DOMAIN_NAME);
+ if (option)
+ __connman_service_set_domainname(service, option->data);
+
+ option = g_dhcp_client_get_option(dhcp_client, G_DHCP_HOST_NAME);
+ if (option)
+ __connman_service_set_hostname(service, option->data);
+
+ option = g_dhcp_client_get_option(dhcp_client, G_DHCP_NTP_SERVER);
+ ns_entries = g_list_length(option);
+ timeservers = g_try_new0(char *, ns_entries + 1);
+ if (timeservers) {
+ for (i = 0, list = option; list; list = list->next, i++)
+ timeservers[i] = g_strdup(list->data);
+ timeservers[ns_entries] = NULL;
+ }
+
+ if (!compare_string_arrays(nameservers, dhcp->nameservers)) {
+ if (dhcp->nameservers) {
+#if defined TIZEN_EXT
+ for (i = 0; dhcp->nameservers[i] != NULL; i++) {
+ __connman_service_nameserver_remove(service,
+ dhcp->nameservers[i], false,
+ CONNMAN_IPCONFIG_TYPE_IPV4);
+ }
+#else
+ for (i = 0; dhcp->nameservers[i]; i++) {
+ __connman_service_nameserver_remove(service,
+ dhcp->nameservers[i], false);
+ }
+#endif
+ g_strfreev(dhcp->nameservers);
+ }
+
+ dhcp->nameservers = nameservers;
+
+ for (i = 0; dhcp->nameservers && dhcp->nameservers[i]; i++) {
+#if defined TIZEN_EXT
+ __connman_service_nameserver_append(service,
+ dhcp->nameservers[i], false,
+ CONNMAN_IPCONFIG_TYPE_IPV4);
+#else
+ __connman_service_nameserver_append(service,
+ dhcp->nameservers[i], false);
+#endif
+ }
+ } else {
+ g_strfreev(nameservers);
+ }
+
+ if (!compare_string_arrays(timeservers, dhcp->timeservers)) {
+ if (dhcp->timeservers) {
+ for (i = 0; dhcp->timeservers[i]; i++) {
+ __connman_service_timeserver_remove(service,
+ dhcp->timeservers[i]);
+ }
+ g_strfreev(dhcp->timeservers);
+ }
+
+ dhcp->timeservers = timeservers;
+
+ for (i = 0; dhcp->timeservers && dhcp->timeservers[i]; i++) {
+ __connman_service_timeserver_append(service,
+ dhcp->timeservers[i]);
+ }
+ } else {
+ g_strfreev(timeservers);
+ }
+
+ if (g_strcmp0(pac, dhcp->pac) != 0) {
+ g_free(dhcp->pac);
+ dhcp->pac = pac;
+
+ __connman_ipconfig_set_proxy_autoconfig(dhcp->ipconfig,
+ dhcp->pac);
+ }
+
+ if (connman_setting_get_bool("Enable6to4"))
+ __connman_6to4_probe(service);
+
+ return true;
+}
+
+static void lease_available_cb(GDHCPClient *dhcp_client, gpointer user_data)
+{
+ struct connman_dhcp *dhcp = user_data;
+ GList *option = NULL;
+ enum connman_ipconfig_method old_method;
+ char *address, *netmask = NULL, *gateway = NULL;
+ const char *c_address, *c_gateway;
+ unsigned char prefixlen, c_prefixlen;
+ bool ip_change = false;
+
+ DBG("Lease available");
+
+ if (dhcp->ipv4ll_client) {
+ ipv4ll_stop_client(dhcp);
+ dhcp_invalidate(dhcp, false);
+ }
+
+ c_address = __connman_ipconfig_get_local(dhcp->ipconfig);
+ c_gateway = __connman_ipconfig_get_gateway(dhcp->ipconfig);
+ c_prefixlen = __connman_ipconfig_get_prefixlen(dhcp->ipconfig);