Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 46208b52 authored by Danny Baumann's avatar Danny Baumann
Browse files

Fix DHCP not woking for routers that hand out very long leases.

As can be seen on
https://github.com/Quarx2k/android_device_motorola_umts_jordan/issues/209,
there are routers that hand out leases with extremely long lease times
(in that bug report: 180 years) instead of using 0xffffffff (infinite).
In those cases, the renewal timer calculations could overflow (as
DhcpInfo.leaseDuration is int), with the result becoming negative and
renewal being re-started because of that. The router ignored that
renewal (too short time inbetween requests), making the second DHCP
attempt fail.

Avoid that scenario by properly casting leaseDuration to long. Also
reduce code duplication to prevent making the same mistake twice ;-)
parent 5ed1fb17
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment