Provide DHCP Server address to upper layer while appending IPv4 Data 71/123571/2
authortaesub kim <taesub.kim@samsung.com>
Thu, 6 Apr 2017 06:33:12 +0000 (15:33 +0900)
committerSaurav Babu <saurav.babu@samsung.com>
Thu, 6 Apr 2017 11:10:40 +0000 (16:40 +0530)
Change-Id: I8d6a33ddeff94c7bbfb56ed7e4d64966be5bcd31
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
gdhcp/client.c
src/ipconfig.c

index 7e04176..ff4539b 100755 (executable)
@@ -3029,7 +3029,11 @@ char *g_dhcp_client_get_server_address(GDHCPClient *dhcp_client)
        if (!dhcp_client)
                return NULL;
 
+#if defined TIZEN_EXT
+       return get_ip(htonl(dhcp_client->server_ip));
+#else
        return get_ip(dhcp_client->server_ip);
+#endif
 }
 
 char *g_dhcp_client_get_address(GDHCPClient *dhcp_client)
index 46239fe..8d1db29 100755 (executable)
@@ -1890,6 +1890,18 @@ void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
        if (append_addr->gateway)
                connman_dbus_dict_append_basic(iter, "Gateway",
                                DBUS_TYPE_STRING, &append_addr->gateway);
+
+#if defined TIZEN_EXT
+       if (ipconfig->method == CONNMAN_IPCONFIG_METHOD_DHCP) {
+               char *server_ip;
+               server_ip = __connman_dhcp_get_server_address(ipconfig);
+               if (server_ip) {
+                       connman_dbus_dict_append_basic(iter, "DHCPServerIP",
+                                       DBUS_TYPE_STRING, &server_ip);
+                       g_free(server_ip);
+               }
+       }
+#endif
 }
 
 void __connman_ipconfig_append_ipv6(struct connman_ipconfig *ipconfig,