From 74d19997c964b60b9f94dc82b5531173f83c1081 Mon Sep 17 00:00:00 2001 From: Forest Bond Date: Mon, 16 Jul 2012 09:09:01 -0400 Subject: [PATCH] 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. --- gdhcp/client.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.7.4