sd-dhcp-client: make timeout handling a bit more robust

System Internals / systemd - Tom Gundersen [jklm.no] - 21 March 2014 11:52 UTC

Accept any lease lifetime greater than one second. Server should not hand out extremely short leases, but let's not be the ones to fail.

Do not fail when arming a timer in the past, but also only arm one such timer.

Avoid rounding errors when computing the default timeouts, this may be an issue if we are handed a very short lease.

Also, don't pass 'time_now' around, as that can be found in the event object when needed.

022446a sd-dhcp-client: make timeout handling a bit more robust
src/libsystemd-network/sd-dhcp-client.c | 157 +++++++++++++++++++------------
1 file changed, 98 insertions(+), 59 deletions(-)

Upstream: github.com


  • Share