Calling maintain_dhcp_lease() always starts renew process (before lease has expired).
In DHCP implementation Lease time, T1 and T2 used as if they are in milliseconds (with ticks_add and _start_ticks, which is in ms), but DHCP defines them in seconds, so they must be multiplied by 1000 when read from packet (lines 628, 634, 636).
On a side note, it looks rather confusing when _lease, _t1, _t2 are used both to store time period and time instant. It saves a few bytes, but does not help readability.
Calling
maintain_dhcp_lease()
always starts renew process (before lease has expired).In DHCP implementation Lease time, T1 and T2 used as if they are in milliseconds (with ticks_add and _start_ticks, which is in ms), but DHCP defines them in seconds, so they must be multiplied by 1000 when read from packet (lines 628, 634, 636).
On a side note, it looks rather confusing when _lease, _t1, _t2 are used both to store time period and time instant. It saves a few bytes, but does not help readability.