diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-03-10 10:43:43 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-11 02:15:38 +0100 |
commit | 4a5dca29b3bd725317eeab9bd8e33cabfb1d22e1 (patch) | |
tree | d012c0aad219647e24ac21695e5877005efc2e2f | |
parent | 660fe70ab835371028143bfee391eed941620fc3 (diff) | |
download | connman-4a5dca29b3bd725317eeab9bd8e33cabfb1d22e1.tar.gz connman-4a5dca29b3bd725317eeab9bd8e33cabfb1d22e1.tar.bz2 connman-4a5dca29b3bd725317eeab9bd8e33cabfb1d22e1.zip |
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
-rw-r--r-- | src/dhcp.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); } |