]> git.ipfire.org Git - thirdparty/dhcpcd.git/commit - src/ipv6nd.c
eloop: Allow for for timeouts greater than time_t and time wrapping
authorRoy Marples <roy@marples.name>
Wed, 1 Jan 2020 11:18:49 +0000 (11:18 +0000)
committerRoy Marples <roy@marples.name>
Wed, 1 Jan 2020 11:18:49 +0000 (11:18 +0000)
commit826d1f25e2e0fde83d7f2a1e36a8c927f80e92b7
tree8f445d3873c92532aa467f98d4db5aecc6744925
parenta2566f54936cd4d8c09f1d43c0f8dc4eae59da36
eloop: Allow for for timeouts greater than time_t and time wrapping

On some systems time_t is int32_t.
However, on wire timeouts are generally uint32_t.
As such, we need to avoid using timespec internally except to
record when the timeout was created. Instead, record the timeout
as unsigned int seconds and long nanoseconds.

On long running systems using time_t as int32_t, monotonic time
would wrap after approximately 68 years. It's highly unlikely dhcpcd
would be running for so long, but just incase it does, the code
should now cope.
src/dhcp.c
src/dhcp.h
src/dhcp6.c
src/dhcpcd.c
src/eloop.c
src/eloop.h
src/if-options.c
src/if-options.h
src/ipv6.c
src/ipv6.h
src/ipv6nd.c