chiark / gitweb /
sd-dhcp-client: make timeout handling a bit more robust
authorTom Gundersen <teg@jklm.no>
Wed, 19 Mar 2014 16:19:22 +0000 (17:19 +0100)
committerTom Gundersen <teg@jklm.no>
Fri, 21 Mar 2014 16:52:42 +0000 (17:52 +0100)
commit022446adf99b84c59a88c2e614033ccde13c395c
tree08e52f56e1000a44b17a3f0930402382b1feb253
parenta853c45d9a85adbed3fa5a4d93b051bf8161015b
sd-dhcp-client: make timeout handling a bit more robust

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.
src/libsystemd-network/sd-dhcp-client.c