diff options
author | Thomas Markwalder <tmark@isc.org> | 2017-12-11 09:19:54 -0500 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2017-12-11 09:19:54 -0500 |
commit | 140612c8cb51825fdf9e5723afb78c997117ab2c (patch) | |
tree | 24caa28a29b4557c2849ba4e310433cb7b245d04 | |
parent | c2e5ee2882d6d9dba5e7227d432552a3ab75b9e2 (diff) | |
download | isc-dhcp-140612c8cb51825fdf9e5723afb78c997117ab2c.tar.gz |
[master] Changes DHCLIENT_DEFAULT_PREFIX_LEN to 128, adds --address-prefix-len to dhclient cli
Merges in rt23252.
-rw-r--r-- | RELNOTES | 9 | ||||
-rw-r--r-- | client/dhc6.c | 4 | ||||
-rw-r--r-- | client/dhclient.c | 19 | ||||
-rw-r--r-- | includes/site.h | 2 |
4 files changed, 28 insertions, 6 deletions
@@ -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. diff --git a/client/dhc6.c b/client/dhc6.c index 357b40e9..e0d052e5 100644 --- a/client/dhc6.c +++ b/client/dhc6.c @@ -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)); } diff --git a/client/dhclient.c b/client/dhclient.c index 94dfbd91..55e1c61c 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -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) { diff --git a/includes/site.h b/includes/site.h index 461eaccf..d9c1494b 100644 --- a/includes/site.h +++ b/includes/site.h @@ -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 |