summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2008-06-12 13:38:41 +0000
committerFrancis Dupont <fdupont@isc.org>2008-06-12 13:38:41 +0000
commitffbaa8801ec3e4806ac70acbeaaa672b0024fe22 (patch)
tree5f4db08733c1474618b0ef4f693dce5c09e379bb /client
parent800977648760bdffadf63fa478c4d4ab2e17a566 (diff)
downloadisc-dhcp-ffbaa8801ec3e4806ac70acbeaaa672b0024fe22.tar.gz
dhclient -6 -1
Diffstat (limited to 'client')
-rw-r--r--client/dhc6.c25
-rw-r--r--client/dhclient.810
2 files changed, 30 insertions, 5 deletions
diff --git a/client/dhc6.c b/client/dhc6.c
index b8dbdd28..b9f79af7 100644
--- a/client/dhc6.c
+++ b/client/dhc6.c
@@ -110,6 +110,7 @@ static void script_write_params6(struct client_state *client,
struct option_state *options);
static isc_boolean_t active_prefix(struct client_state *client);
+extern int onetry;
extern int stateless;
/*
@@ -1316,7 +1317,11 @@ start_init6(struct client_state *client)
client->IRT = SOL_TIMEOUT * 100;
client->MRT = SOL_MAX_RT * 100;
client->MRC = 0;
- client->MRD = 0;
+ /* Default is 0 (no max) but -1 changes this. */
+ if (!onetry)
+ client->MRD = 0;
+ else
+ client->MRD = client->config->timeout;
dhc6_retrans_init(client);
@@ -1368,7 +1373,11 @@ start_info_request6(struct client_state *client)
client->IRT = INF_TIMEOUT * 100;
client->MRT = INF_MAX_RT * 100;
client->MRC = 0;
- client->MRD = 0;
+ /* Default is 0 (no max) but -1 changes this. */
+ if (!onetry)
+ client->MRD = 0;
+ else
+ client->MRD = client->config->timeout;
dhc6_retrans_init(client);
@@ -1490,8 +1499,17 @@ do_init6(void *input)
elapsed.tv_sec -= 1;
elapsed.tv_usec += 1000000;
}
+ /* Check if finished (-1 argument). */
if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) {
log_info("Max retransmission duration exceeded.");
+ client->state = S_STOPPED;
+ if (client->active_lease != NULL) {
+ dhc6_lease_destroy(&client->active_lease, MDL);
+ client->active_lease = NULL;
+ }
+ /* Stop if and only if this is the last client. */
+ if (stopping_finished())
+ exit(2);
return;
}
@@ -1901,9 +1919,10 @@ do_info_request6(void *input)
elapsed.tv_sec -= 1;
elapsed.tv_usec += 1000000;
}
+ /* Check if finished (-1 argument). */
if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) {
log_info("Max retransmission duration exceeded.");
- return;
+ exit(2);
}
memset(&ds, 0, sizeof(ds));
diff --git a/client/dhclient.8 b/client/dhclient.8
index 21f7ed27..49c36c44 100644
--- a/client/dhclient.8
+++ b/client/dhclient.8
@@ -1,4 +1,4 @@
-.\" $Id: dhclient.8,v 1.28 2008/05/23 13:56:07 fdupont Exp $
+.\" $Id: dhclient.8,v 1.29 2008/06/12 13:38:41 fdupont Exp $
.\"
.\" Copyright (c) 2004,2007-2008 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 1996-2003 by Internet Software Consortium
@@ -294,7 +294,13 @@ at shutdown with the specific reason for calling the script set.
The
.B -1
flag will cause dhclient to try once to get a lease. If it fails, dhclient
-exits with exit code two.
+exits with exit code two. In DHCPv6 the
+.B -1
+flag sets the max duration of the initial exchange to
+.I timeout
+(from
+.IR dhclient.conf ,
+default sixty seconds).
.PP
The DHCP client normally gets its configuration information from
.B ETCDIR/dhclient.conf,