summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-08-30 07:43:33 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-08-30 07:43:33 +0000
commit79aeedcbe4b6107a92be9f0af6588bea3c8d20fd (patch)
tree8ce58bb8e5ed782759f49cb03c7b7a5e2391123b
parenta0f4e64c15faf78c32504c8c48893828706a7b52 (diff)
Avoid spinning if the server gives us a bogus zero lease time, by
enforcing a minimum lease time of 60s. ok deraadt@ henning@
-rw-r--r--sbin/dhclient/dhclient.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 719a59573d1..acb549418fc 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.57 2004/07/07 17:00:55 deraadt Exp $ */
+/* $OpenBSD: dhclient.c,v 1.58 2004/08/30 07:43:32 otto Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -617,6 +617,9 @@ dhcpack(struct packet *packet)
because the lease expiry offset is unsigned. */
if (ip->client->new->expiry < 0)
ip->client->new->expiry = TIME_MAX;
+ /* XXX should be fixed by resetting the client state */
+ if (ip->client->new->expiry < 60)
+ ip->client->new->expiry = 60;
/* Take the server-provided renewal time if there is one;
otherwise figure it out according to the spec. */