ping: shorter retry timeouts in DHCP client

Set DHCP-DISCOVER retry timeout and DHCP-REQUEST retry timeout from 10
seconds to 2 seconds. This prevents problems with tests where the NIC
driver comes up slowly and the first packets of the DHCP client get
dropped.

Issue #2837
This commit is contained in:
Martin Stein 2018-05-17 11:31:23 +02:00 committed by Christian Helmuth
parent 0d5ed994e2
commit 75ff599a91
1 changed files with 2 additions and 4 deletions

View File

@ -61,9 +61,8 @@ class Net::Dhcp_client
INIT = 0, SELECT = 1, REQUEST = 2, BOUND = 3, RENEW = 4, REBIND = 5
};
enum { DISCOVER_TIMEOUT_SEC = 10 };
enum { REQUEST_TIMEOUT_SEC = 10 };
enum { OFFER_TIMEOUT_SEC = 10 };
enum { DISCOVER_TIMEOUT_SEC = 2 };
enum { REQUEST_TIMEOUT_SEC = 2 };
Genode::Allocator &_alloc;
State _state { State::INIT };
@ -71,7 +70,6 @@ class Net::Dhcp_client
unsigned long _lease_time_sec = 0;
Genode::Microseconds const _discover_timeout { DISCOVER_TIMEOUT_SEC * 1000 * 1000 };
Genode::Microseconds const _request_timeout { REQUEST_TIMEOUT_SEC * 1000 * 1000 };
Genode::Microseconds const _offer_timeout { OFFER_TIMEOUT_SEC * 1000 * 1000 };
Nic &_nic;
Dhcp_client_handler &_handler;