mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 05:47:45 +00:00
- 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]
This commit is contained in:
parent
4ba5891941
commit
8ea19a715c
6
RELNOTES
6
RELNOTES
@ -74,6 +74,12 @@ the README file.
|
|||||||
|
|
||||||
- Corrected a segmentation violation in DHCPv4 socket processing.
|
- Corrected a segmentation violation in DHCPv4 socket processing.
|
||||||
|
|
||||||
|
- dhclient will now fork() into the background once it binds to an
|
||||||
|
IPv6 address, or immediately if the -n flag is supplised.
|
||||||
|
|
||||||
|
- -q is now the default behaviour on dhclient, with -d or -v enabling
|
||||||
|
non-quiet (stderr logging) mode.
|
||||||
|
|
||||||
Changes since 3.1.0 (NEW FEATURES)
|
Changes since 3.1.0 (NEW FEATURES)
|
||||||
|
|
||||||
- DHCPv6 Client and Server protocol support. Use '-6' to run the daemons
|
- DHCPv6 Client and Server protocol support. Use '-6' to run the daemons
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@ -853,6 +853,9 @@ start_init6(struct client_state *client)
|
|||||||
*/
|
*/
|
||||||
add_timeout(cur_time + (random() % SOL_MAX_DELAY), do_init6, client,
|
add_timeout(cur_time + (random() % SOL_MAX_DELAY), do_init6, client,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
if (nowait)
|
||||||
|
go_daemon();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* start_init6() kicks off an "init-reboot" version of the process, at
|
/* 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)
|
if (old != NULL)
|
||||||
dhc6_marshall_values("old_", client, old,
|
dhc6_marshall_values("old_", client, old,
|
||||||
oldia, oldia->addrs);
|
oldia,
|
||||||
|
oldia != NULL ?
|
||||||
|
oldia->addrs : NULL);
|
||||||
|
|
||||||
dhc6_marshall_values("new_", client, lease, ia,
|
dhc6_marshall_values("new_", client, lease, ia,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
script_go(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2610,8 +2617,12 @@ start_bound(struct client_state *client)
|
|||||||
old->bindings->addrs : NULL);
|
old->bindings->addrs : NULL);
|
||||||
|
|
||||||
dhc6_marshall_values("new_", client, lease, NULL, NULL);
|
dhc6_marshall_values("new_", client, lease, NULL, NULL);
|
||||||
|
|
||||||
|
script_go(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go_daemon();
|
||||||
|
|
||||||
if (client->old_lease != NULL) {
|
if (client->old_lease != NULL) {
|
||||||
dhc6_lease_destroy(client->old_lease, MDL);
|
dhc6_lease_destroy(client->old_lease, MDL);
|
||||||
client->old_lease = NULL;
|
client->old_lease = NULL;
|
||||||
|
@ -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) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
.\" Copyright (c) 1996-2003 by Internet Software Consortium
|
.\" Copyright (c) 1996-2003 by Internet Software Consortium
|
||||||
@ -88,6 +88,12 @@ relay
|
|||||||
.B -w
|
.B -w
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
|
.B -v
|
||||||
|
]
|
||||||
|
[
|
||||||
|
.B --version
|
||||||
|
]
|
||||||
|
[
|
||||||
.I if0
|
.I if0
|
||||||
[
|
[
|
||||||
.I ...ifN
|
.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
|
protocol to obtain whatever PIv6 addresses are available along with
|
||||||
configuration parameters. Information-request is not yet supported.
|
configuration parameters. Information-request is not yet supported.
|
||||||
.PP
|
.PP
|
||||||
|
If given the --version command line argument, dhclient will print its
|
||||||
|
version number and exit.
|
||||||
|
.PP
|
||||||
On startup, dhclient reads the
|
On startup, dhclient reads the
|
||||||
.IR dhclient.conf
|
.IR dhclient.conf
|
||||||
for configuration instructions. It then gets a list of all the
|
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
|
.B -e
|
||||||
.I IF_METRIC=1
|
.I IF_METRIC=1
|
||||||
.PP
|
.PP
|
||||||
The client normally prints a startup message and displays the
|
The client normally prints no output during its startup sequence. It
|
||||||
protocol sequence to the standard error descriptor until it has
|
can be made to emit verbose messages displaying the startup sequence events
|
||||||
acquired an address, and then only logs messages using the
|
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)
|
.B syslog (3)
|
||||||
facility. The
|
facility. A
|
||||||
.B -q
|
.B -q
|
||||||
flag prevents any messages other than errors from being printed to the
|
command line argument is provided for backwards compatibility, but since
|
||||||
standard error descriptor.
|
dhclient is quiet by default, it has no effect.
|
||||||
.PP
|
.PP
|
||||||
The client normally doesn't release the current lease as it is not
|
The client normally doesn't release the current lease as it is not
|
||||||
required by the DHCP protocol. Some cable ISPs require their clients
|
required by the DHCP protocol. Some cable ISPs require their clients
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@ -73,7 +73,7 @@ int no_daemon=0;
|
|||||||
struct string_list *client_env=NULL;
|
struct string_list *client_env=NULL;
|
||||||
int client_env_count=0;
|
int client_env_count=0;
|
||||||
int onetry=0;
|
int onetry=0;
|
||||||
int quiet=0;
|
int quiet=1;
|
||||||
int nowait=0;
|
int nowait=0;
|
||||||
char *mockup_relay = NULL;
|
char *mockup_relay = NULL;
|
||||||
|
|
||||||
@ -169,6 +169,7 @@ main(int argc, char **argv) {
|
|||||||
ntohs (local_port));
|
ntohs (local_port));
|
||||||
} else if (!strcmp (argv [i], "-d")) {
|
} else if (!strcmp (argv [i], "-d")) {
|
||||||
no_daemon = 1;
|
no_daemon = 1;
|
||||||
|
quiet = 0;
|
||||||
} else if (!strcmp (argv [i], "-pf")) {
|
} else if (!strcmp (argv [i], "-pf")) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
@ -193,7 +194,6 @@ main(int argc, char **argv) {
|
|||||||
onetry = 1;
|
onetry = 1;
|
||||||
} else if (!strcmp (argv [i], "-q")) {
|
} else if (!strcmp (argv [i], "-q")) {
|
||||||
quiet = 1;
|
quiet = 1;
|
||||||
quiet_interface_discovery = 1;
|
|
||||||
} else if (!strcmp (argv [i], "-s")) {
|
} else if (!strcmp (argv [i], "-s")) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
@ -221,6 +221,8 @@ main(int argc, char **argv) {
|
|||||||
tmp -> next = client_env;
|
tmp -> next = client_env;
|
||||||
client_env = tmp;
|
client_env = tmp;
|
||||||
client_env_count++;
|
client_env_count++;
|
||||||
|
} else if (!strcmp(argv[i], "-v")) {
|
||||||
|
quiet = 0;
|
||||||
} else if (!strcmp (argv [i], "--version")) {
|
} else if (!strcmp (argv [i], "--version")) {
|
||||||
log_info ("isc-dhclient-%s", DHCP_VERSION);
|
log_info ("isc-dhclient-%s", DHCP_VERSION);
|
||||||
exit (0);
|
exit (0);
|
||||||
@ -299,8 +301,10 @@ main(int argc, char **argv) {
|
|||||||
log_info (arr);
|
log_info (arr);
|
||||||
log_info (url);
|
log_info (url);
|
||||||
log_info ("%s", "");
|
log_info ("%s", "");
|
||||||
} else
|
} else {
|
||||||
log_perror = 0;
|
log_perror = 0;
|
||||||
|
quiet_interface_discovery = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we're given a relay agent address to insert, for testing
|
/* If we're given a relay agent address to insert, for testing
|
||||||
purposes, figure out what it is. */
|
purposes, figure out what it is. */
|
||||||
@ -518,7 +522,7 @@ static void usage ()
|
|||||||
log_info (arr);
|
log_info (arr);
|
||||||
log_info (url);
|
log_info (url);
|
||||||
|
|
||||||
log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
|
log_error ("Usage: dhclient [-1dvr] [-nw] [-p <port>] %s",
|
||||||
"[-s server]");
|
"[-s server]");
|
||||||
log_error (" [-cf config-file] [-lf lease-file]%s",
|
log_error (" [-cf config-file] [-lf lease-file]%s",
|
||||||
"[-pf pid-file] [-e VAR=val]");
|
"[-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);
|
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 ();
|
write_client_pid_file ();
|
||||||
}
|
}
|
||||||
|
@ -2314,6 +2314,8 @@ char *piaddrmask(struct iaddr *, struct iaddr *);
|
|||||||
char *piaddrcidr(const struct iaddr *, unsigned int);
|
char *piaddrcidr(const struct iaddr *, unsigned int);
|
||||||
|
|
||||||
/* dhclient.c */
|
/* dhclient.c */
|
||||||
|
extern int nowait;
|
||||||
|
|
||||||
extern const char *path_dhclient_conf;
|
extern const char *path_dhclient_conf;
|
||||||
extern const char *path_dhclient_db;
|
extern const char *path_dhclient_db;
|
||||||
extern const char *path_dhclient_pid;
|
extern const char *path_dhclient_pid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user