From: Roy Marples Date: Thu, 14 Jan 2010 02:23:19 +0000 (+0000) Subject: Infinite lease times are always valid when reading leases. X-Git-Tag: v5.1.5~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5e7ea017c85957bf05fcc99c814d243548a2cc3;p=thirdparty%2Fdhcpcd.git Infinite lease times are always valid when reading leases. --- diff --git a/dhcpcd.c b/dhcpcd.c index 989458e6..ea6803b3 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1158,13 +1158,14 @@ start_interface(void *arg) free(iface->state->offer); iface->state->offer = NULL; } - } else if (stat(iface->leasefile, &st) == 0 && - get_option_uint32(&l, iface->state->offer, - DHO_LEASETIME) == 0) + } else if (iface->state->lease.leasetime != ~0U && + stat(iface->leasefile, &st) == 0) { /* Offset lease times and check expiry */ gettimeofday(&now, NULL); - if ((time_t)l < now.tv_sec - st.st_mtime) { + if ((time_t)iface->state->lease.leasetime < + now.tv_sec - st.st_mtime) + { free(iface->state->offer); iface->state->offer = NULL; } else {