struct option_state *options);
static isc_boolean_t active_prefix(struct client_state *client);
+extern int onetry;
extern int stateless;
/*
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);
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);
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;
}
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));
-.\" $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
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,