summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorForest Bond <forest.bond@rapidrollout.com>2012-07-16 13:09:01 (GMT)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-07-17 08:22:12 (GMT)
commit74d19997c964b60b9f94dc82b5531173f83c1081 (patch)
tree3c9cfa33f2b18ce395b5bab6758380a9b3c8aa12 /gdhcp
parent18af3028c215a28732acf55099559074154aa26e (diff)
downloadconnman-74d19997c964b60b9f94dc82b5531173f83c1081.zip
connman-74d19997c964b60b9f94dc82b5531173f83c1081.tar.gz
connman-74d19997c964b60b9f94dc82b5531173f83c1081.tar.bz2
gdhcp: Set client state to INIT_SELECTING on restart
With the previous behavior, we would end up sending a discover message and then ignoring the reply due to the client state mismatch, so a restart would never result in successful acquisition of a lease. RFC 2131 specifies that the client should return to INIT state in various restart scenarios. However, also note that it would not make sense in any case to send a discover message and ignore the reply.
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/client.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 7e8e494..cf04ced 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1361,6 +1361,7 @@ static void restart_dhcp(GDHCPClient *dhcp_client, int retry_times)
dhcp_client->retry_times = retry_times;
dhcp_client->requested_ip = 0;
+ dhcp_client->state = INIT_SELECTING;
switch_listening_mode(dhcp_client, L2);
g_dhcp_client_start(dhcp_client, dhcp_client->last_address);