summaryrefslogtreecommitdiff
path: root/client/clparse.c
diff options
context:
space:
mode:
authorTomek Mrugalski <tomek@isc.org>2011-04-21 13:24:24 +0000
committerTomek Mrugalski <tomek@isc.org>2011-04-21 13:24:24 +0000
commit5d082abd92512487ca885d74656ba48d6e39b2f6 (patch)
tree2c37a21a777f8cd193cdb3579a23733da2986686 /client/clparse.c
parent5ce8d6e7496a842e1eb770eb636b6480ad328d12 (diff)
downloadisc-dhcp-5d082abd92512487ca885d74656ba48d6e39b2f6.tar.gz
Several time related improvements:
- set initial delay to 0 to speed up client start - added 'initial-delay' parameter to possibly revert to old behavior - better handling of very short (1 or 2s) leases - client lease records are recorded at most once every 15 seconds - ICMP ping-check is now timed more precisely - Servers that don't offer lease-time are now black-listed [ISC-Bugs #19660]
Diffstat (limited to 'client/clparse.c')
-rw-r--r--client/clparse.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/client/clparse.c b/client/clparse.c
index c4245ce7..9de4ce26 100644
--- a/client/clparse.c
+++ b/client/clparse.c
@@ -3,7 +3,7 @@
Parser for dhclient config and lease files... */
/*
- * Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
@@ -128,6 +128,16 @@ isc_result_t read_client_conf ()
top_level_config.retry_interval = 300;
top_level_config.backoff_cutoff = 15;
top_level_config.initial_interval = 3;
+
+ /*
+ * RFC 2131, section 4.4.1 specifies that the client SHOULD wait a
+ * random time between 1 and 10 seconds. However, we choose to not
+ * implement this default. If user is inclined to really have that
+ * delay, he is welcome to do so, using 'initial-delay X;' parameter
+ * in config file.
+ */
+ top_level_config.initial_delay = 0;
+
top_level_config.bootp_policy = P_ACCEPT;
top_level_config.script_name = path_dhclient_script;
top_level_config.requested_options = default_requested_options;
@@ -209,7 +219,7 @@ int read_client_conf_file (const char *name, struct interface_info *ip,
const char *val;
int token;
isc_result_t status;
-
+
if ((file = open (name, O_RDONLY)) < 0)
return uerr2isc (errno);
@@ -645,6 +655,11 @@ void parse_client_statement (cfile, ip, config)
parse_lease_time (cfile, &config -> initial_interval);
return;
+ case INITIAL_DELAY:
+ token = next_token (&val, (unsigned *)0, cfile);
+ parse_lease_time (cfile, &config -> initial_delay);
+ return;
+
case SCRIPT:
token = next_token (&val, (unsigned *)0, cfile);
parse_string (cfile, &config -> script_name, (unsigned *)0);
@@ -2218,4 +2233,3 @@ int parse_allow_deny (oc, cfile, flag)
skip_to_semi (cfile);
return 0;
}
-