From: Daniel Wagner Date: Thu, 10 Mar 2011 09:43:43 +0000 (+0100) Subject: dhcp: Stop pending gdhcp client requests X-Git-Tag: 2.0_alpha~1659 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a5dca29b3bd725317eeab9bd8e33cabfb1d22e1;p=framework%2Fconnectivity%2Fconnman.git dhcp: Stop pending gdhcp client requests When remove_network is called there could be still a pending dhcp request in the dhcp client. Fixes BMC#13947 --- diff --git a/src/dhcp.c b/src/dhcp.c index bedc555..6fda67d 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -314,9 +314,14 @@ static int dhcp_release(struct connman_dhcp *dhcp) { DBG("dhcp %p", dhcp); + if (dhcp->dhcp_client == NULL) + return 0; + g_dhcp_client_stop(dhcp->dhcp_client); g_dhcp_client_unref(dhcp->dhcp_client); + dhcp->dhcp_client = NULL; + return 0; } @@ -326,6 +331,8 @@ static void remove_network(gpointer user_data) DBG("dhcp %p", dhcp); + dhcp_release(dhcp); + dhcp_free(dhcp); g_free(dhcp); }