summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-12-29 14:36:05 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-12-29 14:36:05 +0000
commit1b4adbe6bbf2d89fdb7b33d71ae41dfcae163567 (patch)
tree986186449937ec19cbde29269d35863b71244d70
parent84e1c81771e4b6571ab145763860a482897993b8 (diff)
If no LEASE_TIME was received from the server, use the
default_lease_time (12 hours); I'm not entirely certain the fallback is correct, but the RFC does not say what the client should do if no LEASE_TIME is given by the server. Closes PR 1077
-rw-r--r--usr.sbin/dhcp/dhclient/dhclient.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/dhcp/dhclient/dhclient.c b/usr.sbin/dhcp/dhclient/dhclient.c
index 7d585f49d7e..33cd3493066 100644
--- a/usr.sbin/dhcp/dhclient/dhclient.c
+++ b/usr.sbin/dhcp/dhclient/dhclient.c
@@ -56,7 +56,7 @@
#ifndef lint
static char copyright[] =
-"$Id: dhclient.c,v 1.11 2000/10/30 02:35:33 deraadt Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.12 2000/12/29 14:36:04 angelos Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -458,9 +458,12 @@ void dhcpack (packet)
cancel_timeout (send_request, ip);
/* Figure out the lease time. */
- ip -> client -> new -> expiry =
- getULong (ip -> client ->
- new -> options [DHO_DHCP_LEASE_TIME].data);
+ if (ip -> client -> new -> options [DHO_DHCP_LEASE_TIME].data)
+ ip -> client -> new -> expiry =
+ getULong (ip -> client ->
+ new -> options [DHO_DHCP_LEASE_TIME].data);
+ else
+ ip -> client -> new -> expiry = default_lease_time;
/* Take the server-provided renewal time if there is one;
otherwise figure it out according to the spec. */