Just before starting the DHCP procedure return to mainloop first. This
fixes some cases where the interface is not yet up. This happens mainly
when using Bluetooth PAN connections where the network interface will be
newly created every single time.
connman_dhcp_bound(dhcp);
}
+static gboolean start_dhcp(gpointer user_data)
+{
+ GDHCPClient *dhcp_client = user_data;
+
+ g_dhcp_client_start(dhcp_client);
+
+ return FALSE;
+}
+
static int dhcp_request(struct connman_dhcp *dhcp)
{
GDHCPClient *dhcp_client;
g_dhcp_client_ref(dhcp_client);
- return g_dhcp_client_start(dhcp_client);
+ g_timeout_add_seconds(0, start_dhcp, dhcp_client);
+
+ return 0;
}
static int dhcp_release(struct connman_dhcp *dhcp)