Skip to content

maintain_dhcp_lease() Always triggers lease renewal #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jahor opened this issue Jun 24, 2024 · 1 comment · Fixed by #169
Closed

maintain_dhcp_lease() Always triggers lease renewal #168

Jahor opened this issue Jun 24, 2024 · 1 comment · Fixed by #169

Comments

@Jahor
Copy link
Contributor

Jahor commented Jun 24, 2024

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.

@FoamyGuy
Copy link
Contributor

Thanks for reporting this issue. Are you interested / willing to make a PR with the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants