Imported Upstream version 1.29
[platform/upstream/connman.git] / src / dhcp.c
index 505d9f0..09f462b 100644 (file)
@@ -582,6 +582,17 @@ static int dhcp_release(struct connman_dhcp *dhcp)
        return 0;
 }
 
+char *__connman_dhcp_get_server_address(struct connman_ipconfig *ipconfig)
+{
+       struct connman_dhcp *dhcp;
+
+       dhcp = g_hash_table_lookup(ipconfig_table, ipconfig);
+       if (!dhcp)
+               return NULL;
+
+       return g_dhcp_client_get_server_address(dhcp->dhcp_client);
+}
+
 int __connman_dhcp_start(struct connman_ipconfig *ipconfig,
                        struct connman_network *network, dhcp_cb callback,
                        gpointer user_data)
@@ -672,4 +683,6 @@ void __connman_dhcp_cleanup(void)
 
        g_hash_table_destroy(ipconfig_table);
        ipconfig_table = NULL;
+
+       dhcp_cleanup_random();
 }