Blame SOURCES/dhcp-dhclient_ipv6_prefix.patch

26a25c
diff --git a/client/dhc6.c b/client/dhc6.c
26a25c
index 5460ee1..fe0057c 100644
26a25c
--- a/client/dhc6.c
26a25c
+++ b/client/dhc6.c
26a25c
@@ -148,6 +148,7 @@ static int dhc6_score_lease(struct client_state *client,
26a25c
 
26a25c
 extern int onetry;
26a25c
 extern int stateless;
26a25c
+extern int address_prefix_len;
26a25c
 
26a25c
 /*
26a25c
  * Assign DHCPv6 port numbers as a client.
26a25c
@@ -4364,7 +4365,7 @@ dhc6_marshall_values(const char *prefix, struct client_state *client,
26a25c
 				      (unsigned) addr->plen);
26a25c
 		} else {
26a25c
 			client_envadd(client, prefix, "ip6_prefixlen",
26a25c
-				      "%d", DHCLIENT_DEFAULT_PREFIX_LEN);
26a25c
+				      "%d", address_prefix_len);
26a25c
 			client_envadd(client, prefix, "ip6_address",
26a25c
 				      "%s", piaddr(addr->address));
26a25c
 		}
26a25c
diff --git a/client/dhclient.c b/client/dhclient.c
26a25c
index b61da43..05bfc7e 100644
26a25c
--- a/client/dhclient.c
26a25c
+++ b/client/dhclient.c
26a25c
@@ -114,6 +114,7 @@ char *progname = NULL;
26a25c
 
26a25c
 int bootp_broadcast_always = 0;
26a25c
 
26a25c
+int address_prefix_len = DHCLIENT_DEFAULT_PREFIX_LEN;
26a25c
 extern struct option *default_requested_options[];
26a25c
 
26a25c
 void run_stateless(int exit_mode, u_int16_t port);
26a25c
@@ -192,6 +193,7 @@ usage(const char *sfmt, const char *sarg)
26a25c
 #endif
26a25c
 #else /* DHCPv6 */
26a25c
 		  "[-I1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n"
26a25c
+                   "                [--address-prefix-len length]\n"
26a25c
 #endif /* DHCPv6 */
26a25c
 		  "                [-s server-addr] [-cf config-file]\n"
26a25c
 		  "                [-df duid-file] [-lf lease-file]\n"
26a25c
@@ -392,6 +394,17 @@ main(int argc, char **argv) {
26a25c
 			tmp->next = client_env;
26a25c
 			client_env = tmp;
26a25c
 			client_env_count++;
26a25c
+		} else if (!strcmp(argv[i], "--address-prefix-len")) {
26a25c
+			if (++i == argc) {
26a25c
+				usage(use_noarg, argv[i-1]);
26a25c
+			}
26a25c
+			errno = 0;
26a25c
+			address_prefix_len = (int)strtol(argv[i], &s, 10);
26a25c
+			if (errno || (*s != '\0') ||
26a25c
+			    (address_prefix_len < 0)) {
26a25c
+ 		                usage("Invalid value for"       
26a25c
+				      " --address-prefix-len: %s", argv[i]);
26a25c
+                       }
26a25c
 #ifdef DHCPv6
26a25c
 		} else if (!strcmp(argv[i], "-S")) {
26a25c
 			if (local_family_set && (local_family == AF_INET)) {
26a25c
diff --git a/includes/site.h b/includes/site.h
26a25c
index b2f7fd7..aad9711 100644
26a25c
--- a/includes/site.h
26a25c
+++ b/includes/site.h
26a25c
@@ -286,7 +286,7 @@
26a25c
    is a host address and doesn't include any on-link information.
26a25c
    64 indicates that the first 64 bits are the subnet or on-link
26a25c
    prefix. */
26a25c
-#define DHCLIENT_DEFAULT_PREFIX_LEN 64
26a25c
+#define DHCLIENT_DEFAULT_PREFIX_LEN 128
26a25c
 
26a25c
 /* Enable the gentle shutdown signal handling.  Currently this
26a25c
    means that on SIGINT or SIGTERM a client will release its
26a25c
diff --git a/client/dhclient.c b/client/dhclient.c
26a25c
index 2f29591..6c8b145 100644
26a25c
diff --git a/client/dhclient.c b/client/dhclient.c
26a25c
index b0bf2bf..f7b1476 100644
26a25c
--- a/client/dhclient.c
26a25c
+++ b/client/dhclient.c
26a25c
@@ -193,7 +193,6 @@ usage(const char *sfmt, const char *sarg)
26a25c
 #endif
26a25c
 #else /* DHCPv6 */
26a25c
 		  "[-I1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n"
26a25c
-                   "                [--address-prefix-len length]\n"
26a25c
 #endif /* DHCPv6 */
26a25c
 		  "                [-s server-addr] [-cf config-file]\n"
26a25c
 		  "                [-df duid-file] [-lf lease-file]\n"
26a25c
@@ -202,6 +201,7 @@ usage(const char *sfmt, const char *sarg)
26a25c
 		  "                [-C <dhcp-client-identifier>] [-B]\n"
26a25c
 		  "                [-H <host-name> | -F <fqdn.fqdn>] [--timeout <timeout>]\n"
26a25c
 		  "                [-V <vendor-class-identifier>]\n"
26a25c
+		  "                [--address-prefix-len length]\n"
26a25c
 		  "                [--request-options <request option list>]",
26a25c
 		  isc_file_basename(progname));
26a25c
 }