diff --git a/src/servers/net/DHCPClient.cpp b/src/servers/net/DHCPClient.cpp
index d5ffd0e..211fc6c 100644
a
|
b
|
|
39 | 39 | #define DHCP_CLIENT_PORT 68 |
40 | 40 | #define DHCP_SERVER_PORT 67 |
41 | 41 | |
42 | | #define DEFAULT_TIMEOUT 4 // secs |
| 42 | #define DEFAULT_TIMEOUT 1 // secs |
43 | 43 | #define MAX_TIMEOUT 64 // secs |
44 | 44 | |
45 | 45 | #define MAX_RETRIES 5 |
… |
… |
DHCPClient::~DHCPClient()
|
489 | 489 | status_t |
490 | 490 | DHCPClient::Initialize() |
491 | 491 | { |
| 492 | bool old = fAssignedAddress == 0; |
492 | 493 | fStatus = _Negotiate(fAssignedAddress == 0 ? INIT : INIT_REBOOT); |
493 | | syslog(LOG_DEBUG, "%s: DHCP status = %s\n", Device(), strerror(fStatus)); |
| 494 | syslog(LOG_DEBUG, "%s: DHCP status = %s %s\n", Device(), strerror(fStatus), old ? "reusing": ""); |
494 | 495 | return fStatus; |
495 | 496 | } |
496 | 497 | |
… |
… |
DHCPClient::_ResetTimeout(int socket, dhcp_state& state, time_t& timeout,
|
901 | 902 | tries = 0; |
902 | 903 | |
903 | 904 | struct timeval value; |
904 | | value.tv_sec = timeout; |
905 | | value.tv_usec = rand() % 1000000; |
| 905 | value.tv_sec = 0; |
| 906 | value.tv_usec = 200000 + rand() % 200000; |
906 | 907 | setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &value, sizeof(value)); |
907 | 908 | } |
908 | 909 | |