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 595408 Details for
Bug 836702
dhclient -P -N should handle combined prefix delegation and address assignment correctly
[?]
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]
mixed -P -N mode support for dhclient 4.2.4
dhcp-4.2.4.patch (text/plain), 11.27 KB, created by
Scott Shambarger
on 2012-06-30 04:38:56 UTC
(
hide
)
Description:
mixed -P -N mode support for dhclient 4.2.4
Filename:
MIME Type:
Creator:
Scott Shambarger
Created:
2012-06-30 04:38:56 UTC
Size:
11.27 KB
patch
obsolete
>diff -up SOURCES/dhclient-script-original SOURCES/dhclient-script >--- SOURCES/dhclient-script-original 2012-06-29 21:26:54.538388275 -0700 >+++ SOURCES/dhclient-script 2012-06-29 16:36:49.417278052 -0700 >@@ -338,7 +338,7 @@ dhconfig() { > ip -4 addr del ${old_ip_address} dev ${interface} label ${interface}:0 > fi > >- if [ -n "${old_ip_address}" ] && >+ if [ -n "${old_ip_address}" ] && [ -z "${client}" ] > [ ! "${old_ip_address}" = "${new_ip_address}" ]; then > # IP address changed. Delete all routes, and clear the ARP cache. > flush_dev ${interface} >@@ -658,6 +658,9 @@ case "${reason}" in > ;; > > PREINIT) >+ # no-op for psuedo-interfaces >+ [ -n "${client}" ] && return >+ > if [ -n "${alias_ip_address}" ]; then > # Flush alias, its routes will disappear too. > ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1 >@@ -676,6 +679,9 @@ case "${reason}" in > ;; > > PREINIT6) >+ # no-op for psuedo-interfaces >+ [ -n "${client}" ] && return >+ > # ensure interface is up > ip link set dev ${interface} up > >@@ -737,8 +743,15 @@ case "${reason}" in > fi > > if [ -n "${old_ip_address}" ]; then >- # Delete addresses/routes/arp cache. >- flush_dev ${interface} >+ if [ -n "${client}" ]; then >+ # for pseudo interface, just delete old address >+ ip -4 addr del ${old_ip_address} dev ${interface} >+ # flush ARP >+ ip -4 neigh flush dev ${interface} >/dev/null 2>&1 >+ else >+ # Delete addresses/routes/arp cache. >+ flush_dev ${interface} >+ fi > fi > > if [ -n "${alias_ip_address}" ]; then >@@ -763,7 +776,7 @@ case "${reason}" in > exit_with_hooks 0 > fi > >- flush_dev ${interface} >+ [ -z "${client}" ] && flush_dev ${interface} > exit_with_hooks 1 > else > exit_with_hooks 1 >diff -Nup SOURCES/dhcp-4.2.4-mixedwanted.patch SOURCES/dhcp-4.2.4-mixedwanted.patch >--- SOURCES/dhcp-4.2.4-mixedwanted.patch-original 1969-12-31 16:00:00.000000000 -0800 >+++ SOURCES/dhcp-4.2.4-mixedwanted.patch 2012-06-29 20:39:29.148934887 -0700 >@@ -0,0 +1,250 @@ >+diff -pu dhcp-4.2.4/client/dhc6.c.mixedwanted dhcp-4.2.4/client/dhc6.c >+--- dhcp-4.2.4/client/dhc6.c.mixedwanted 2012-06-29 19:24:01.396657910 -0700 >++++ dhcp-4.2.4/client/dhc6.c 2012-06-29 19:24:01.421657935 -0700 >+@@ -1446,6 +1446,41 @@ unexpired_address_in_lease(struct dhc6_l >+ return ISC_FALSE; >+ } >+ >++static void check_mixed_wanted(struct client_state *client, >++ int *pna, int *pta, int *ppd) >++{ >++ struct client_state *cp; >++ >++ if(pna) >++ *pna = wanted_ia_na; >++ if(pta) >++ *pta = wanted_ia_ta; >++ if(ppd) >++ *ppd = wanted_ia_pd; >++ >++ if(! (wanted_ia_pd && (wanted_ia_na || wanted_ia_ta))) >++ return; >++ >++ for(cp = client->interface->client; cp; cp = cp->next) { >++ >++ if(cp->name && ! strcmp(cp->name, "pd-handler")) { >++ >++ /* we have a dedicated IA_PD handler */ >++ if(client == cp) { >++ if(pna) >++ *pna = 0; >++ if(pta) >++ *pta = 0; >++ } >++ else { >++ if(ppd) >++ *ppd = 0; >++ } >++ break; >++ } >++ } >++} >++ >+ /* >+ * start_confirm6() kicks off an "init-reboot" version of the process, at >+ * startup to find out if old bindings are 'fair' and at runtime whenever >+@@ -1455,6 +1490,7 @@ void >+ start_confirm6(struct client_state *client) >+ { >+ struct timeval tv; >++ int want_pd; >+ >+ /* If there is no active lease, there is nothing to check. */ >+ if ((client->active_lease == NULL) || >+@@ -1491,7 +1527,10 @@ start_confirm6(struct client_state *clie >+ tv.tv_sec += 1; >+ tv.tv_usec -= 1000000; >+ } >+- if (wanted_ia_pd != 0) { >++ >++ check_mixed_wanted(client, NULL, NULL, &want_pd); >++ >++ if (want_pd != 0) { >+ client->state = S_REBINDING; >+ client->refresh_type = DHCPV6_REBIND; >+ add_timeout(&tv, do_refresh6, client, NULL, NULL); >+@@ -1589,6 +1628,7 @@ do_init6(void *input) >+ struct timeval tv; >+ u_int32_t t1, t2; >+ int i, idx, len, send_ret; >++ int want_na, want_ta, want_pd; >+ >+ client = input; >+ >+@@ -1630,8 +1670,10 @@ do_init6(void *input) >+ client->v6_handler = rapid_commit_handler; >+ } >+ >++ check_mixed_wanted(client, &want_na, &want_ta, &want_pd); >++ >+ /* Append IA_NA. */ >+- for (i = 0; i < wanted_ia_na; i++) { >++ for (i = 0; i < want_na; i++) { >+ /* >+ * XXX: maybe the IA_NA('s) should be put into the sent_options >+ * cache. They'd have to be pulled down as they also contain >+@@ -1734,7 +1776,7 @@ do_init6(void *input) >+ } >+ >+ /* Append IA_TA. */ >+- for (i = 0; i < wanted_ia_ta; i++) { >++ for (i = 0; i < want_ta; i++) { >+ /* >+ * XXX: maybe the IA_TA('s) should be put into the sent_options >+ * cache. They'd have to be pulled down as they also contain >+@@ -1830,7 +1872,7 @@ do_init6(void *input) >+ } >+ >+ /* Append IA_PD. */ >+- for (i = 0; i < wanted_ia_pd; i++) { >++ for (i = 0; i < want_pd; i++) { >+ /* >+ * XXX: maybe the IA_PD('s) should be put into the sent_options >+ * cache. They'd have to be pulled down as they also contain >+@@ -2152,6 +2194,7 @@ do_release6(void *input) >+ struct data_string ds; >+ int send_ret; >+ struct timeval tv; >++ int want_na, want_pd; >+ >+ client = input; >+ >+@@ -2177,14 +2220,16 @@ do_release6(void *input) >+ client->sent_options, &global_scope, >+ &dhcpv6_universe); >+ >++ check_mixed_wanted(client, &want_na, NULL, &want_pd); >++ >+ /* Append IA's (but don't release temporary addresses). */ >+- if (wanted_ia_na && >++ if (want_na && >+ dhc6_add_ia_na(client, &ds, client->active_lease, >+ DHCPV6_RELEASE) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+ goto release_done; >+ } >+- if (wanted_ia_pd && >++ if (want_pd && >+ dhc6_add_ia_pd(client, &ds, client->active_lease, >+ DHCPV6_RELEASE) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+@@ -3217,6 +3262,7 @@ do_select6(void *input) >+ struct data_string ds; >+ struct timeval tv; >+ int send_ret; >++ int want_na, want_ta, want_pd; >+ >+ client = input; >+ >+@@ -3268,20 +3314,22 @@ do_select6(void *input) >+ NULL, client->sent_options, &global_scope, >+ &dhcpv6_universe); >+ >++ check_mixed_wanted(client, &want_na, &want_ta, &want_pd); >++ >+ /* Now append any IA's, and within them any IAADDR/IAPREFIXs. */ >+- if (wanted_ia_na && >++ if (want_na && >+ dhc6_add_ia_na(client, &ds, lease, >+ DHCPV6_REQUEST) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+ return; >+ } >+- if (wanted_ia_ta && >++ if (want_ta && >+ dhc6_add_ia_ta(client, &ds, lease, >+ DHCPV6_REQUEST) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+ return; >+ } >+- if (wanted_ia_pd && >++ if (want_pd && >+ dhc6_add_ia_pd(client, &ds, lease, >+ DHCPV6_REQUEST) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+@@ -4475,6 +4523,7 @@ do_decline6(void *input) >+ struct data_string ds; >+ int send_ret; >+ struct timeval elapsed, tv; >++ int want_na, want_pd; >+ >+ client = input; >+ >+@@ -4532,14 +4581,16 @@ do_decline6(void *input) >+ client->sent_options, &global_scope, >+ &dhcpv6_universe); >+ >++ check_mixed_wanted(client, &want_na, NULL, &want_pd); >++ >+ /* Append IA's (but don't release temporary addresses). */ >+- if (wanted_ia_na && >++ if (want_na && >+ dhc6_add_ia_na(client, &ds, client->active_lease, >+ DHCPV6_DECLINE) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+ goto decline_done; >+ } >+- if (wanted_ia_pd && >++ if (want_pd && >+ dhc6_add_ia_pd(client, &ds, client->active_lease, >+ DHCPV6_DECLINE) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+@@ -4633,6 +4684,7 @@ do_refresh6(void *input) >+ struct dhc6_lease *lease; >+ struct timeval elapsed, tv; >+ int send_ret; >++ int want_na, want_pd; >+ >+ client = (struct client_state *)input; >+ memset(&ds, 0, sizeof(ds)); >+@@ -4739,14 +4791,16 @@ do_refresh6(void *input) >+ client->sent_options, &global_scope, >+ &dhcpv6_universe); >+ >++ check_mixed_wanted(client, &want_na, NULL, &want_pd); >++ >+ /* Append IA's */ >+- if (wanted_ia_na && >++ if (want_na && >+ dhc6_add_ia_na(client, &ds, lease, >+ client->refresh_type) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+ return; >+ } >+- if (wanted_ia_pd && >++ if (want_pd && >+ dhc6_add_ia_pd(client, &ds, lease, >+ client->refresh_type) != ISC_R_SUCCESS) { >+ data_string_forget(&ds, MDL); >+diff -pu dhcp-4.2.4/client/dhclient.c.mixedwanted dhcp-4.2.4/client/dhclient.c >+--- dhcp-4.2.4/client/dhclient.c.mixedwanted 2012-06-29 19:24:01.418657930 -0700 >++++ dhcp-4.2.4/client/dhclient.c 2012-06-29 19:24:01.422657935 -0700 >+@@ -3333,6 +3333,12 @@ write_client6_lease(struct client_state >+ if (stat <= 0) >+ return ISC_R_IOERROR; >+ >++ if (client->name) { >++ stat = fprintf(leaseFile, " name \"%s\";\n", client->name); >++ if (stat <= 0) >++ return ISC_R_IOERROR; >++ } >++ >+ for (ia = lease->bindings ; ia != NULL ; ia = ia->next) { >+ switch (ia->ia_type) { >+ case D6O_IA_NA: >+diff -pu dhcp-4.2.4/client/dhclient.8.mixedwanted dhcp-4.2.4/client/dhclient.8 >+--- dhcp-4.2.4/client/dhclient.8.mixedwanted 2012-06-29 19:24:01.435657947 -0700 >++++ dhcp-4.2.4/client/dhclient.8 2012-06-29 20:38:33.201881031 -0700 >+@@ -464,7 +464,11 @@ See \fB\-N\fR to restore it. >+ .BI \-P >+ Enable IPv6 prefix delegation. This implies \fB\-6\fR and also >+ disables the normal address query. See \fB\-N\fR to restore it. >+-Note only one requested interface is allowed. >++Note only one requested interface is allowed. If used in combination >++with \fB-N\fR or \fB-T\fR and a pseudo-interface named "pd-handler" is >++configured, the pseudo interface is used to exclusively to handle >++prefix delegation (which handles incompatibilities in the state >++handling between the modes). >+ .TP >+ .BI \-D \ LL\ or\ LLT >+ Override the default when selecting the type of DUID to use. By default, >diff -up SPECS/dhcp.spec-original SPECS/dhcp.spec >--- SPECS/dhcp.spec-original 2012-06-29 21:26:54.565388289 -0700 >+++ SPECS/dhcp.spec 2012-06-29 20:40:37.224001161 -0700 >@@ -18,7 +18,7 @@ > Summary: Dynamic host configuration protocol software > Name: dhcp > Version: 4.2.4 >-Release: 2%{?dist} >+Release: 3%{?dist} > # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to > # dcantrell maintaining the package) made incorrect use of the epoch and > # that's why it is at 12 now. It should have never been used, but it was. >@@ -73,6 +73,7 @@ Patch38: dhcp-4.2.3-P2-log_perror.patch > Patch39: dhcp-4.2.4-getifaddrs.patch > Patch40: dhcp-4.2.4-send_release.patch > Patch41: dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch >+Patch42: dhcp-4.2.4-mixedwanted.patch > > BuildRequires: autoconf > BuildRequires: automake >@@ -97,8 +98,10 @@ Requires(postun): systemd-units > # In _docdir we ship some perl scripts and module from contrib subdirectory. > # Because nothing under _docdir is allowed to "require" anything, > # prevent _docdir from being scanned. (#674058) >+%{?filter_setup: > %filter_requires_in %{_docdir} > %filter_setup >+} > > %description > DHCP (Dynamic Host Configuration Protocol) is a protocol which allows >@@ -300,6 +303,9 @@ rm bind/bind.tar.gz > # RFC5970 - DHCPv6 Options for Network Boot (#798735) > %patch41 -p1 -b .rfc5970 > >+# Mixing -P and -N options require pseudo interface to handle prefix delegation >+%patch42 -p1 -b .mixedwanted >+ > pushd contrib > %{__chmod} -x 3.0b1-lease-convert dhclient-tz-exithook.sh ldap/dhcpd-conf-to-ldap > %{__chmod} -x sethostname.sh solaris.init
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 836702
:
595408
|
596115
|
617803
|
665807
|
850306
|
850307