summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/dhcp/dhclient/dhclient.83
-rw-r--r--usr.sbin/dhcp/dhclient/dhclient.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/dhcp/dhclient/dhclient.8 b/usr.sbin/dhcp/dhclient/dhclient.8
index dd8c12777cb..3439bf7ce18 100644
--- a/usr.sbin/dhcp/dhclient/dhclient.8
+++ b/usr.sbin/dhcp/dhclient/dhclient.8
@@ -45,6 +45,9 @@ dhclient - Dynamic Host Configuration Protocol Client
.I port
]
[
+.B -1
+]
+[
.B -d
]
[
diff --git a/usr.sbin/dhcp/dhclient/dhclient.c b/usr.sbin/dhcp/dhclient/dhclient.c
index 161389c0744..719dc7a7ed5 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.1 1998/09/12 08:55:14 deraadt Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.2 1998/09/20 08:49:35 deraadt Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -92,6 +92,7 @@ u_int16_t remote_port;
int log_priority;
int no_daemon;
int save_scripts;
+int onetry;
static void usage PROTO ((void));
@@ -126,6 +127,8 @@ int main (argc, argv, envp)
no_daemon = 1;
} else if (!strcmp (argv [i], "-D")) {
save_scripts = 1;
+ } else if (!strcmp (argv [i], "-1")) {
+ onetry = 1;
} else if (argv [i][0] == '-') {
usage ();
} else {
@@ -244,7 +247,7 @@ int main (argc, argv, envp)
static void usage ()
{
- error ("Usage: dhclient [-c] [-p <port>] [interface]");
+ error ("Usage: dhclient [-1] [-c] [-p <port>] [interface]");
}
void cleanup ()
@@ -1094,6 +1097,8 @@ void state_panic (ipp)
/* No leases were available, or what was available didn't work, so
tell the shell script that we failed to allocate an address,
and try again later. */
+ if (onetry)
+ exit(1);
note ("No working leases in persistent database - sleeping.\n");
script_init (ip, "FAIL", (struct string_list *)0);
if (ip -> client -> alias)