summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorSaurav Babu <saurav.babu@samsung.com>2016-01-28 18:24:51 +0530
committerPatrik Flykt <patrik.flykt@linux.intel.com>2016-01-29 12:39:59 +0200
commit686e1feb681008a6c8db1feb44436d86f4f34e77 (patch)
tree7d49f1cc5c07506b32996c36ddb55f3a0ebabb1f /gdhcp
parentfda98dc17386056eb2258aca8b21efca337d9424 (diff)
downloadconnman-686e1feb681008a6c8db1feb44436d86f4f34e77.tar.gz
gdhcp: Don't try to remove timer again
GLib-CRITICAL warning message is obtained in below scenario: 1. service is connected and link local address is obtained. 2. Try to disconnect service. (connmand:8377): GLib-CRITICAL **: Source ID 289 was not found when attempting to remove it (connmand:8377): GLib-CRITICAL **: Source ID 303 was not found when attempting to remove it When Link Local IP address is obtained then both dhcp_client->timeout assigned for DISCOVER_TIMEOUT and ANNOUNCE_INTERVAL are already removed when discover_timeout() and ipv4ll_announce_timeout() function returns FALSE but the dhcp_client->timeout is not assigned to 0. Now when dhcp_release() calls remove_timeouts() function then dhcp_client->timeout is tried to remove again resulting in GLib-CRITICAL warning. This patch removes all possible remaing timeouts in g_dhcp_client_start() and explicitly sets dhcp_client->timeout to 0 in ipv4ll_announce_timeout() function.
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index f9cba894..3bf8cb2b 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -2681,6 +2681,7 @@ static gboolean ipv4ll_announce_timeout(gpointer dhcp_data)
dhcp_client->ipv4ll_available_cb(dhcp_client,
dhcp_client->ipv4ll_available_data);
dhcp_client->conflicts = 0;
+ dhcp_client->timeout = 0;
return FALSE;
}
@@ -2713,6 +2714,8 @@ int g_dhcp_client_start(GDHCPClient *dhcp_client, const char *last_address)
uint32_t addr;
uint64_t rand;
+ remove_timeouts(dhcp_client);
+
if (dhcp_client->type == G_DHCP_IPV6) {
if (dhcp_client->information_req_cb) {
dhcp_client->state = INFORMATION_REQ;