summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-03-10 10:43:43 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-11 02:15:38 +0100
commit4a5dca29b3bd725317eeab9bd8e33cabfb1d22e1 (patch)
treed012c0aad219647e24ac21695e5877005efc2e2f
parent660fe70ab835371028143bfee391eed941620fc3 (diff)
downloadconnman-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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index bedc5554..6fda67d9 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);
}