diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-11-11 15:39:21 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-11-11 15:39:21 +0000 |
commit | d020414d1ab9f3ee949009c95a791f78769ac6d0 (patch) | |
tree | 47efe1aff9b759d8f1c4d7b47e3bc43bb8265662 /sbin | |
parent | 8394bc8538809a19abe41193dc5f421d92ba744a (diff) |
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@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 5 | ||||
-rw-r--r-- | sbin/dhclient/dhclient.conf.5 | 10 |
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, |