+
+ switch (ipconfig->method) {
+ case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
+ case CONNMAN_IPCONFIG_METHOD_OFF:
+ break;
+
+ case CONNMAN_IPCONFIG_METHOD_FIXED:
+ case CONNMAN_IPCONFIG_METHOD_MANUAL:
+ ipconfig->address->prefixlen =
+ store_get_int(&is, "netmask_prefixlen");
+
+ g_free(ipconfig->address->local);
+ ipconfig->address->local =
+ store_get_str(&is, "local_address");
+
+ g_free(ipconfig->address->peer);
+ ipconfig->address->peer =
+ store_get_str(&is, "peer_address");
+
+ g_free(ipconfig->address->broadcast);
+ ipconfig->address->broadcast =
+ store_get_str(&is, "broadcast_address");
+
+ g_free(ipconfig->address->gateway);
+ ipconfig->address->gateway =
+ store_get_str(&is, "gateway");
+ break;
+
+ case CONNMAN_IPCONFIG_METHOD_AUTO:
+ if (ipconfig->type != CONNMAN_IPCONFIG_TYPE_IPV4)
+ break;
+
+ /*
+ * If the last used method for IPv4 was AUTO then we
+ * try first DHCP. We will try also to use the last
+ * used DHCP address, if exits.
+ */
+ __connman_ipconfig_set_method(ipconfig,
+ CONNMAN_IPCONFIG_METHOD_DHCP);
+ /* fall through */
+
+ case CONNMAN_IPCONFIG_METHOD_DHCP:
+ str = store_get_str(&is, "DHCP.LastAddress");
+ if (str) {
+ g_free(ipconfig->last_dhcp_address);
+ ipconfig->last_dhcp_address = str;
+ }
+
+ break;
+ }