Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 850071 Details for
Bug 876791
dhclient6 -P needs a way to specify prefix length
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proof of concept patch. Probably not for production.
dhcp-4.2.4-prefix-len.patch (text/plain), 3.03 KB, created by
H. Peter Anvin
on 2014-01-14 18:07:35 UTC
(
hide
)
Description:
Proof of concept patch. Probably not for production.
Filename:
MIME Type:
Creator:
H. Peter Anvin
Created:
2014-01-14 18:07:35 UTC
Size:
3.03 KB
patch
obsolete
>diff --git a/client/dhc6.c b/client/dhc6.c >index 633f9b1..64c4086 100644 >--- a/client/dhc6.c >+++ b/client/dhc6.c >@@ -1549,6 +1549,7 @@ do_init6(void *input) > struct timeval tv; > u_int32_t t1, t2; > int i, idx, len, send_ret; >+ int req_prefix; > > client = input; > >@@ -1790,6 +1791,7 @@ do_init6(void *input) > } > > /* Append IA_PD. */ >+ req_prefix = 0; > for (i = 0; i < wanted_ia_pd; i++) { > /* > * XXX: maybe the IA_PD('s) should be put into the sent_options >@@ -1850,6 +1852,10 @@ do_init6(void *input) > continue; > } > >+ /* Ignore an old binding if too small */ >+ if (ia_pd_plen && old_addr->plen > ia_pd_plen) >+ continue; >+ > if (!buffer_allocate(&addr.buffer, 25, MDL)) { > log_error("Unable to allocate memory " > "for IAPREFIX."); >@@ -1886,7 +1892,46 @@ do_init6(void *input) > &addr); > > data_string_forget(&addr, MDL); >+ >+ req_prefix++; >+ } >+ } >+ >+ if (ia_pd_plen && !req_prefix) { >+ memset(&addr, 0, sizeof(addr)); >+ if (!buffer_allocate(&addr.buffer, 25, MDL)) { >+ log_error("Unable to allocate memory " >+ "for IAPREFIX."); >+ data_string_forget(&ia, MDL); >+ data_string_forget(&ds, MDL); >+ return; > } >+ >+ addr.data = addr.buffer->data; >+ addr.len = 25; >+ >+ t1 = client->config->requested_lease; >+ t2 = t1 + (t1 / 2); >+ putULong(addr.buffer->data, t1); >+ putULong(addr.buffer->data + 4, t2); >+ >+ putUChar(addr.buffer->data + 8, ia_pd_plen); >+ memset(addr.buffer->data + 9, 0, 16); >+ >+ log_debug("XMT: | X-- Request prefix ::/%u.", >+ (unsigned) ia_pd_plen); >+ log_debug("XMT: | | X-- Request " >+ "preferred in +%u", >+ (unsigned)t1); >+ log_debug("XMT: | | X-- Request valid " >+ "in +%u", >+ (unsigned)t2); >+ >+ append_option(&ia, &dhcpv6_universe, >+ iaprefix_option, >+ &addr); >+ >+ data_string_forget(&addr, MDL); > } > > append_option(&ds, &dhcpv6_universe, ia_pd_option, &ia); >diff --git a/client/dhclient.c b/client/dhclient.c >index fc60383..9af025f 100644 >--- a/client/dhclient.c >+++ b/client/dhclient.c >@@ -83,6 +83,7 @@ int onetry = 0; > int quiet = 1; > int nowait = 0; > int stateless = 0; >+unsigned int ia_pd_plen = 0; > int wanted_ia_na = -1; /* the absolute value is the real one. */ > int wanted_ia_ta = 0; > int wanted_ia_pd = 0; >@@ -289,6 +290,13 @@ main(int argc, char **argv) { > wanted_ia_na = 0; > } > wanted_ia_pd++; >+ } else if (!strcmp(argv[i], "--prefix-len")) { >+ char *ep; >+ if (++i == argc) >+ usage(); >+ ia_pd_plen = strtoul(argv[i], &ep, 10); >+ if (*ep || ia_pd_plen < 4 || ia_pd_plen > 127) >+ usage(); > } else if (!strcmp(argv[i], "-D")) { > if (local_family_set && (local_family == AF_INET)) { > usage(); >diff --git a/includes/dhcpd.h b/includes/dhcpd.h >index 459dea5..097cda8 100644 >--- a/includes/dhcpd.h >+++ b/includes/dhcpd.h >@@ -2680,6 +2680,7 @@ extern int nowait; > extern int wanted_ia_na; > extern int wanted_ia_ta; > extern int wanted_ia_pd; >+extern unsigned int ia_pd_plen; > > extern const char *path_dhclient_conf; > extern const char *path_dhclient_db;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 876791
: 850071 |
850891