summaryrefslogtreecommitdiff
path: root/src/dhcp.c
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2016-06-14 18:12:33 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2016-06-14 18:12:33 +0530
commit2ba57348d65eea4956b9cf13c2fcce0292944e80 (patch)
tree0079be649a55209025ef04895d826de81ed21cdb /src/dhcp.c
parentdf976843d429e47179ecd8f8e7535a34013ea25f (diff)
downloadconnman-2ba57348d65eea4956b9cf13c2fcce0292944e80.tar.gz
connman-2ba57348d65eea4956b9cf13c2fcce0292944e80.tar.bz2
connman-2ba57348d65eea4956b9cf13c2fcce0292944e80.zip
[SPIN] network: enable DHCP failure.
When DHCP is failed, most of normal users cannot understand auto-generated IP (IPV4 link local). So set error CONNMAN_NETWORK_ERROR_DHCP_FAIL. Change-Id: Ic80eb0436e41cff3a4bfb11dfef722b3029b0399 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'src/dhcp.c')
-rwxr-xr-xsrc/dhcp.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index e4497fcc..bc7deb21 100755
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -476,11 +476,24 @@ done:
static void ipv4ll_available_cb(GDHCPClient *ipv4ll_client, gpointer user_data)
{
struct connman_dhcp *dhcp = user_data;
- char *address, *netmask;
- unsigned char prefixlen;
+#if !defined TIZEN_EXT
+ char *address, *netmask;
+ unsigned char prefixlen;
+#endif
DBG("IPV4LL available");
+#if defined TIZEN_EXT
+ /*
+ * Description: When DHCP is failed,
+ * most of normal users cannot understand auto-generated IP
+ * (IPV4 link local) and serious troubles to make Internet connection.
+ */
+ dhcp_invalidate(dhcp, true);
+
+ connman_network_set_error(dhcp->network,
+ CONNMAN_NETWORK_ERROR_DHCP_FAIL);
+#else
address = g_dhcp_client_get_address(ipv4ll_client);
netmask = g_dhcp_client_get_netmask(ipv4ll_client);
@@ -496,6 +509,7 @@ static void ipv4ll_available_cb(GDHCPClient *ipv4ll_client, gpointer user_data)
g_free(address);
g_free(netmask);
+#endif
}
static int dhcp_initialize(struct connman_dhcp *dhcp)