summaryrefslogtreecommitdiffstats
path: root/eloop.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-09-17 13:09:30 +0000
committerRoy Marples <roy@marples.name>2008-09-17 13:09:30 +0000
commitf7038ab8b9bcd3bb651d7decbfba3744b00a1c81 (patch)
tree2009d1c36208091203a5c88824c8e630f2df4aae /eloop.c
parent5c39a95174cf4fa01fece35c6fbd67c13a39cf2b (diff)
downloaddhcpcd-f7038ab8b9bcd3bb651d7decbfba3744b00a1c81.tar.xz
As we now use times to trigger again instead of decreasing timers, ensure our lease fits. We may wish to revisit this again if we need decreasing timers once more.
Diffstat (limited to 'eloop.c')
-rw-r--r--eloop.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/eloop.c b/eloop.c
index 8f601349..4b9b6b6a 100644
--- a/eloop.c
+++ b/eloop.c
@@ -117,6 +117,11 @@ add_timeout_tv(const struct timeval *when,
get_monotonic(&now);
timeradd(&now, when, &w);
+ /* Check for time_t overflow. */
+ if (timercmp(&w, &now, <)) {
+ errno = ERANGE;
+ return;
+ }
/* Remove existing timeout if present */
for (t = timeouts; t; t = t->next) {