summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-11-21 14:56:29 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-11-21 14:56:29 +0000
commit5f1344797f8c76cef24409077dac6f2565e9b420 (patch)
treedefbd08814927e521f8e4371ebfef2b8f726f9ea /sbin/dhclient
parent6c578b3834a4cf2a8054a104c6c435abca5a5020 (diff)
When REBOOT'ing it is necessary to apply_defaults() to the recorded
lease and use the updated values to initialize ifi->expiry and ifi->rebinding. Fixes odd behaviour, bouncing the link in particular, when using dhclient.conf to change the lease renew/rebind/expiry timing. e.g. when debugging wifi interface behaviour.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 3579b55d6e3..46c30079297 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.683 2020/11/20 18:48:22 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.684 2020/11/21 14:56:28 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -724,6 +724,8 @@ state_preboot(struct interface_info *ifi)
void
state_reboot(struct interface_info *ifi)
{
+ struct client_lease *lease;
+
cancel_timeout(ifi);
/*
@@ -736,8 +738,10 @@ state_reboot(struct interface_info *ifi)
state_init(ifi);
return;
}
- ifi->expiry = lease_expiry(ifi->active);
- ifi->rebind = lease_rebind(ifi->active);
+ lease = apply_defaults(ifi->active);
+ ifi->expiry = lease_expiry(lease);
+ ifi->rebind = lease_rebind(lease);
+ free_client_lease(lease);
ifi->xid = arc4random();
make_request(ifi, ifi->active);