summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2017-11-23 14:19:18 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2017-11-23 14:19:18 +0000
commit3873592a5a1ebefb9a8c605d2469f8f2ae7f60e3 (patch)
treee4b8cbfb25a6caf6261436ed7121ff634559e8eb /sbin
parent08df52708934e060b4a1703b6567cb299daf5441 (diff)
Fix use of lease_expiry() in set_lease_times(). lease_expiry() returns
wall clock time, not length of lease time.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index c339e84b064..b878a8d6418 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.525 2017/11/20 13:33:58 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.526 2017/11/23 14:19:17 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2502,7 +2502,7 @@ set_lease_times(struct client_lease *lease)
* &&
* expiry >= MIN(time_max, 60)
*/
- lease->expiry = lease_expiry(lease);
+ lease->expiry = lease_expiry(lease) - lease->epoch;
lease->renewal = lease->expiry / 2;
if (lease->options[DHO_DHCP_RENEWAL_TIME].len == sizeof(uint32val)) {
@@ -2526,6 +2526,7 @@ set_lease_times(struct client_lease *lease)
lease->rebind = lease->renewal;
/* Convert lease lengths to times. */
+ lease->expiry += lease->epoch;
lease->renewal += lease->epoch;
lease->rebind += lease->epoch;
}