summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2007-05-18 18:45:51 +0000
committerDavid Hankins <dhankins@isc.org>2007-05-18 18:45:51 +0000
commit8ea19a715ca048eaeddb8de61fb0a4b426487eaa (patch)
treed0315e85e869393250a40c4298a88dfab93a170a /client
parent4ba58919418c8d9807fc298a4b19a7429367b36d (diff)
downloadisc-dhcp-8ea19a715ca048eaeddb8de61fb0a4b426487eaa.tar.gz
- dhclient will now fork() into the background once it binds to an
IPv6 address, or immediately if the -n flag is supplised. [ISC-Bugs #16872] - -q is now the default behaviour on dhclient, with -d or -v enabling non-quiet (stderr logging) mode. [ISC-Bugs #16872]
Diffstat (limited to 'client')
-rw-r--r--client/dhc6.c15
-rw-r--r--client/dhclient.826
-rw-r--r--client/dhclient.c15
3 files changed, 41 insertions, 15 deletions
diff --git a/client/dhc6.c b/client/dhc6.c
index 2c6ce374..5df80254 100644
--- a/client/dhc6.c
+++ b/client/dhc6.c
@@ -24,7 +24,7 @@
#ifndef lint
static char ocopyright[] =
-"$Id: dhc6.c,v 1.3 2007/05/17 18:27:10 dhankins Exp $ Copyright (c) 2006 Internet Systems Consortium. All rights reserved.\n";
+"$Id: dhc6.c,v 1.4 2007/05/18 18:45:51 dhankins Exp $ Copyright (c) 2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -853,6 +853,9 @@ start_init6(struct client_state *client)
*/
add_timeout(cur_time + (random() % SOL_MAX_DELAY), do_init6, client,
NULL, NULL);
+
+ if (nowait)
+ go_daemon();
}
/* start_init6() kicks off an "init-reboot" version of the process, at
@@ -2592,10 +2595,14 @@ start_bound(struct client_state *client)
if (old != NULL)
dhc6_marshall_values("old_", client, old,
- oldia, oldia->addrs);
+ oldia,
+ oldia != NULL ?
+ oldia->addrs : NULL);
dhc6_marshall_values("new_", client, lease, ia,
NULL);
+
+ script_go(client);
}
}
@@ -2610,8 +2617,12 @@ start_bound(struct client_state *client)
old->bindings->addrs : NULL);
dhc6_marshall_values("new_", client, lease, NULL, NULL);
+
+ script_go(client);
}
+ go_daemon();
+
if (client->old_lease != NULL) {
dhc6_lease_destroy(client->old_lease, MDL);
client->old_lease = NULL;
diff --git a/client/dhclient.8 b/client/dhclient.8
index f82ce161..9391dff8 100644
--- a/client/dhclient.8
+++ b/client/dhclient.8
@@ -1,4 +1,4 @@
-.\" $Id: dhclient.8,v 1.21 2007/05/08 23:05:20 dhankins Exp $
+.\" $Id: dhclient.8,v 1.22 2007/05/18 18:45:51 dhankins Exp $
.\"
.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 1996-2003 by Internet Software Consortium
@@ -88,6 +88,12 @@ relay
.B -w
]
[
+.B -v
+]
+[
+.B --version
+]
+[
.I if0
[
.I ...ifN
@@ -116,6 +122,9 @@ If given the -6 command line argument, dhclient will use the DHCPv6
protocol to obtain whatever PIv6 addresses are available along with
configuration parameters. Information-request is not yet supported.
.PP
+If given the --version command line argument, dhclient will print its
+version number and exit.
+.PP
On startup, dhclient reads the
.IR dhclient.conf
for configuration instructions. It then gets a list of all the
@@ -211,14 +220,17 @@ just as one would assign a variable in a shell. Eg:
.B -e
.I IF_METRIC=1
.PP
-The client normally prints a startup message and displays the
-protocol sequence to the standard error descriptor until it has
-acquired an address, and then only logs messages using the
+The client normally prints no output during its startup sequence. It
+can be made to emit verbose messages displaying the startup sequence events
+until it has acquired an address by supplying the
+.B -v
+command line argument. In either case, the client logs messages using
+the
.B syslog (3)
-facility. The
+facility. A
.B -q
-flag prevents any messages other than errors from being printed to the
-standard error descriptor.
+command line argument is provided for backwards compatibility, but since
+dhclient is quiet by default, it has no effect.
.PP
The client normally doesn't release the current lease as it is not
required by the DHCP protocol. Some cable ISPs require their clients
diff --git a/client/dhclient.c b/client/dhclient.c
index 33d399f7..97b881a0 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -32,7 +32,7 @@
#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.148 2007/05/17 18:27:10 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.149 2007/05/18 18:45:51 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -73,7 +73,7 @@ int no_daemon=0;
struct string_list *client_env=NULL;
int client_env_count=0;
int onetry=0;
-int quiet=0;
+int quiet=1;
int nowait=0;
char *mockup_relay = NULL;
@@ -169,6 +169,7 @@ main(int argc, char **argv) {
ntohs (local_port));
} else if (!strcmp (argv [i], "-d")) {
no_daemon = 1;
+ quiet = 0;
} else if (!strcmp (argv [i], "-pf")) {
if (++i == argc)
usage ();
@@ -193,7 +194,6 @@ main(int argc, char **argv) {
onetry = 1;
} else if (!strcmp (argv [i], "-q")) {
quiet = 1;
- quiet_interface_discovery = 1;
} else if (!strcmp (argv [i], "-s")) {
if (++i == argc)
usage ();
@@ -221,6 +221,8 @@ main(int argc, char **argv) {
tmp -> next = client_env;
client_env = tmp;
client_env_count++;
+ } else if (!strcmp(argv[i], "-v")) {
+ quiet = 0;
} else if (!strcmp (argv [i], "--version")) {
log_info ("isc-dhclient-%s", DHCP_VERSION);
exit (0);
@@ -299,8 +301,10 @@ main(int argc, char **argv) {
log_info (arr);
log_info (url);
log_info ("%s", "");
- } else
+ } else {
log_perror = 0;
+ quiet_interface_discovery = 1;
+ }
/* If we're given a relay agent address to insert, for testing
purposes, figure out what it is. */
@@ -518,7 +522,7 @@ static void usage ()
log_info (arr);
log_info (url);
- log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
+ log_error ("Usage: dhclient [-1dvr] [-nw] [-p <port>] %s",
"[-s server]");
log_error (" [-cf config-file] [-lf lease-file]%s",
"[-pf pid-file] [-e VAR=val]");
@@ -3024,7 +3028,6 @@ void go_daemon ()
open("/dev/null", O_RDWR);
open("/dev/null", O_RDWR);
open("/dev/null", O_RDWR);
- log_perror = 0; /* No sense logging to /dev/null. */
write_client_pid_file ();
}