#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.128 2001/04/09 00:34:06 mellon Exp $ Copyright (c) 1995-2001 Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.129 2001/04/16 22:07:33 mellon Exp $ Copyright (c) 1995-2001 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
u_int16_t local_port;
u_int16_t remote_port;
int no_daemon;
-int save_scripts;
struct string_list *client_env;
int client_env_count;
int onetry;
int quiet;
+int nowait;
static void usage PROTO ((void));
ntohs (local_port));
} else if (!strcmp (argv [i], "-d")) {
no_daemon = 1;
- } else if (!strcmp (argv [i], "-D")) {
- save_scripts = 1;
} else if (!strcmp (argv [i], "-pf")) {
if (++i == argc)
usage ();
} else if (!strcmp (argv [i], "--version")) {
log_info ("isc-dhclient-%s", DHCP_VERSION);
exit (0);
+ } else if (!strcmp (argv [i], "-nw")) {
+ nowait = 1;
} else {
struct interface_info *tmp = (struct interface_info *)0;
status = interface_allocate (&tmp, MDL);
dmalloc_outstanding = 0;
#endif
+ /* If we're not supposed to wait before getting the address,
+ don't. */
+ if (nowait)
+ go_daemon ();
+
/* If we're not going to daemonize, write the pid file
now. */
- if (no_daemon)
+ if (no_daemon || nowait)
write_client_pid_file ();
/* Start dispatching packets and timeouts... */
log_info (arr);
log_info (url);
- log_error ("Usage: dhclient [-1dDqr] [-p <port>] %s",
+ log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
"[-s server]");
log_error (" [-cf config-file] [-lf lease-file]%s",
"[-pf pid-file] [-e VAR=val]");