summaryrefslogtreecommitdiff
path: root/sbin/dhclient/clparse.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2021-02-27 17:44:59 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2021-02-27 17:44:59 +0000
commitf9cee147b48087e97fa7d7e24e4d94b647b2f2ae (patch)
tree9315b7f5c0edfbebe6156657a071c3f2faf711c1 /sbin/dhclient/clparse.c
parent78b05f82e7740668301433ddd43526828937ccbb (diff)
Stop checking 'epoch' in get_recorded_lease() and just set it as
required in read_lease_db(). It's already set in packet_to_lease() and thus both paths to TAILQ_INSERT(lease_db) ensure there is a non-zero epoch in all lease_db entries.
Diffstat (limited to 'sbin/dhclient/clparse.c')
-rw-r--r--sbin/dhclient/clparse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index 11442e0e6ec..051b3bb7a73 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clparse.c,v 1.202 2021/02/21 18:16:59 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.203 2021/02/27 17:44:58 krw Exp $ */
/* Parser for dhclient config and lease files. */
@@ -234,6 +234,8 @@ read_lease_db(struct client_lease_tq *lease_db)
free_client_lease(lp);
}
+ if (lease->epoch == 0)
+ time(&lease->epoch);
TAILQ_INSERT_TAIL(lease_db, lease, next);
}