summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2018-02-06 21:01:28 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2018-02-06 21:01:28 +0000
commitb07ee77fe9a39a9d6d29ba651496304aa39ac185 (patch)
treee7ed95f1178393c44adde7dcca2add0b9a1c9dda /sbin
parent8b9fe91702597ba84ff1792e755e1d34a899b3f1 (diff)
When binding a lease from the dhclient.leasees.<if> file and
the renewal time is in the past wait retry_interval before trying to renew the lease.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index a40a6ab5c76..9f54fa1e086 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.556 2018/02/06 05:09:51 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.557 2018/02/06 21:01:27 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -1076,8 +1076,17 @@ newlease:
ifi->state = S_BOUND;
- /* Set timeout to start the renewal process. */
- set_timeout(ifi, renewal - cur_time, state_bound);
+ /*
+ * Set timeout to start the renewal process.
+ *
+ * If the renewal time is in the past, the lease is from the
+ * leaseDB. Rather than immediately trying to contact a server,
+ * pause the configured time between attempts.
+ */
+ if (renewal < cur_time)
+ set_timeout(ifi, config->retry_interval, state_bound);
+ else
+ set_timeout(ifi, renewal - cur_time, state_bound);
}
/*