]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Infinite lease times are always valid when reading leases.
authorRoy Marples <roy@marples.name>
Thu, 14 Jan 2010 02:23:19 +0000 (02:23 +0000)
committerRoy Marples <roy@marples.name>
Thu, 14 Jan 2010 02:23:19 +0000 (02:23 +0000)
dhcpcd.c

index 989458e64fb8520caf94fd57453de1fb3f4709eb..ea6803b3c849e47b6a8934755149c01c9a2bc0a4 100644 (file)
--- 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 {