2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

Several time related improvements:

- set initial delay to 0 to speed up client start
- added 'initial-delay' parameter to possibly revert to old behavior
- better handling of very short (1 or 2s) leases
- client lease records are recorded at most once every 15 seconds
- ICMP ping-check is now timed more precisely
- Servers that don't offer lease-time are now black-listed
[ISC-Bugs #19660]
This commit is contained in:
Tomek Mrugalski
2011-04-21 13:24:24 +00:00
parent 5ce8d6e749
commit 5d082abd92
9 changed files with 219 additions and 71 deletions

View File

@@ -2836,8 +2836,14 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
log_debug ("Ping timeout: %ld", (long)ping_timeout);
#endif
tv . tv_sec = cur_time + ping_timeout;
tv . tv_usec = 0;
/*
* Set a timeout for 'ping-timeout' seconds from NOW, including
* current microseconds. As ping-timeout defaults to 1, the
* exclusion of current microseconds causes a value somewhere
* /between/ zero and one.
*/
tv.tv_sec = cur_tv.tv_sec + ping_timeout;
tv.tv_usec = cur_tv.tv_usec;
add_timeout (&tv, lease_ping_timeout, lease,
(tvref_t)lease_reference,
(tvunref_t)lease_dereference);