summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2020-11-21 14:56:28 +0000
committerkrw <krw@openbsd.org>2020-11-21 14:56:28 +0000
commit6103a6b49ea415b580973ab54c80e5b6b1f64e1d (patch)
tree5edcc6ac3a35921b53ec5e85ffc5390ba0a59617 /sbin/dhclient
parentGroups are optional (diff)
downloadwireguard-openbsd-6103a6b49ea415b580973ab54c80e5b6b1f64e1d.tar.xz
wireguard-openbsd-6103a6b49ea415b580973ab54c80e5b6b1f64e1d.zip
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);