Commit 140612c8 authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[master] Changes DHCLIENT_DEFAULT_PREFIX_LEN to 128, adds --address-prefix-len to dhclient cli

    Merges in rt23252.
parent c2e5ee28
......@@ -303,6 +303,15 @@ dhcp-users@lists.isc.org.
leases file. Default is true.
[ISC-Bugs #45046]
- Changed the default value of the prefix length passed by dhclient into the
client script for each IPv6 address, from 64 to 128. In addition, dhclient
now supports a command line argument, --address-prefix-len <len>, which may
be used to override the default value. PLEASE NOTE: If your DHCPv6 clients
require a value other than 128, you MUST specify the value via this new
command line argument. Prior to this the only way to alter the value was at
compile time by changing DHCLIENT_DEFAULT_PREFIX_LEN in include/sites.h.
[ISC-Bugs #23252]
Changes since 4.3.0 (bug fixes)
- Tidy up several small tickets.
......
......@@ -154,7 +154,7 @@ static int drop_declined_addrs(struct dhc6_lease *lease);
extern int onetry;
extern int stateless;
extern int prefix_len_hint;
extern int address_prefix_len;
/*
* Assign DHCPv6 port numbers as a client.
......@@ -4434,7 +4434,7 @@ dhc6_marshall_values(const char *prefix, struct client_state *client,
(unsigned) addr->plen);
} else {
client_envadd(client, prefix, "ip6_prefixlen",
"%d", DHCLIENT_DEFAULT_PREFIX_LEN);
"%d", address_prefix_len);
client_envadd(client, prefix, "ip6_address",
"%s", piaddr(addr->address));
}
......
......@@ -105,6 +105,7 @@ int dad_wait_time = 0;
int prefix_len_hint = 0;
#endif
int address_prefix_len = DHCLIENT_DEFAULT_PREFIX_LEN;
char *mockup_relay = NULL;
char *progname = NULL;
......@@ -163,12 +164,14 @@ static const char use_v6command[] = "Command not used for DHCPv4: %s";
#define DHCLIENT_USAGE0 \
"[-4|-6] [-SNTPRI1dvrxi] [-nw] -4o6 <port>] [-p <port>] [-D LL|LLT]\n" \
" [--dad-wait-time <seconds>] [--prefix-len-hint <length>]\n" \
" [--decline-wait-time <seconds>]\n"
" [--decline-wait-time <seconds>]\n" \
" [--address-prefix-len length]\n"
#else /* DHCP4o6 */
#define DHCLIENT_USAGE0 \
"[-4|-6] [-SNTPRI1dvrxi] [-nw] [-p <port>] [-D LL|LLT]\n" \
" [--dad-wait-time <seconds>] [--prefix-len-hint <length>]\n" \
" [--decline-wait-time <seconds>]\n"
" [--decline-wait-time <seconds>]\n" \
" [--address-prefix-len length]\n"
#endif
#else /* DHCPv6 */
#define DHCLIENT_USAGE0 \
......@@ -495,7 +498,6 @@ main(int argc, char **argv) {
if (++i == argc) {
usage(use_noarg, argv[i-1]);
}
errno = 0;
dad_wait_time = (int)strtol(argv[i], &s, 10);
if (errno || (*s != '\0') || (dad_wait_time < 0)) {
......@@ -513,6 +515,17 @@ main(int argc, char **argv) {
usage("Invalid value for --prefix-len-hint: %s",
argv[i]);
}
} else if (!strcmp(argv[i], "--address-prefix-len")) {
if (++i == argc) {
usage(use_noarg, argv[i-1]);
}
errno = 0;
address_prefix_len = (int)strtol(argv[i], &s, 10);
if (errno || (*s != '\0') ||
(address_prefix_len < 0)) {
usage("Invalid value for"
" --address-prefix-len: %s", argv[i]);
}
#endif /* DHCPv6 */
} else if (!strcmp(argv[i], "--decline-wait-time")) {
if (++i == argc) {
......
......@@ -285,7 +285,7 @@
is a host address and doesn't include any on-link information.
64 indicates that the first 64 bits are the subnet or on-link
prefix. */
#define DHCLIENT_DEFAULT_PREFIX_LEN 64
#define DHCLIENT_DEFAULT_PREFIX_LEN 128
/* Enable the gentle shutdown signal handling. Currently this
means that on SIGINT or SIGTERM a client will release its
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment