summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2013-11-11 15:39:20 +0000
committerkrw <krw@openbsd.org>2013-11-11 15:39:20 +0000
commit31995c4ffe2604201c60b982e3dc16dbdd2032d5 (patch)
treed0c88fcc9546e2904a9b0a176ec87532dabf5f90
parentReplace sc_dying in favour of usbd_is_dying() and usbd_deactivate(). (diff)
downloadwireguard-openbsd-31995c4ffe2604201c60b982e3dc16dbdd2032d5.tar.xz
wireguard-openbsd-31995c4ffe2604201c60b982e3dc16dbdd2032d5.zip
RFC 2131 and friends state that when renewing a lease the client
will begin by using unicast communications with the server, and fall back to using broadcast packets if unicast fails. We were not failing back, but instead doggedly sticking with unicast attempts until the lease expired. Instead, try unicast requests for the reboot timeout interval and then switch to using broadcast requests. Problem reported by Marc Peters and Dennis den Brok via misc@. ok dlg@ millert@
-rw-r--r--sbin/dhclient/dhclient.c5
-rw-r--r--sbin/dhclient/dhclient.conf.510
2 files changed, 11 insertions, 4 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 32076c2fa95..18d60c06f53 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.263 2013/10/22 18:15:58 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.264 2013/11/11 15:39:20 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -1359,7 +1359,8 @@ send_request(void)
destination.sin_family = AF_INET;
destination.sin_len = sizeof(destination);
- if (client->state != S_REQUESTING)
+ if ((client->state != S_REQUESTING) &&
+ (interval <= config->reboot_timeout))
from.s_addr = client->active->address.s_addr;
else
from.s_addr = INADDR_ANY;
diff --git a/sbin/dhclient/dhclient.conf.5 b/sbin/dhclient/dhclient.conf.5
index 573f9544505..f60b109413d 100644
--- a/sbin/dhclient/dhclient.conf.5
+++ b/sbin/dhclient/dhclient.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dhclient.conf.5,v 1.30 2013/07/16 09:45:28 schwarze Exp $
+.\" $OpenBSD: dhclient.conf.5,v 1.31 2013/11/11 15:39:20 krw Exp $
.\"
.\" Copyright (c) 1997 The Internet Software Consortium.
.\" All rights reserved.
@@ -36,7 +36,7 @@
.\" see ``http://www.isc.org/isc''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
.\"
-.Dd $Mdocdate: July 16 2013 $
+.Dd $Mdocdate: November 11 2013 $
.Dt DHCLIENT.CONF 5
.Os
.Sh NAME
@@ -133,6 +133,12 @@ The
statement sets the time that must elapse after the client first tries
to reacquire its old address before it gives up and tries to discover
a new address.
+.Pp
+The value of
+.Ic reboot
+is also used to control how long a client will attempt unicast renewal
+requests before falling back to using broadcast requests.
+.Pp
By default, the reboot timeout is ten seconds.
.It Ic backoff-cutoff Ar time ;
The client uses an exponential backoff algorithm with some randomness,