From 3681f4b8900e749453359e23f1a46d13a9586670 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 05 2019 19:03:44 +0000 Subject: import dhcp-4.3.6-34.el8 --- diff --git a/README.debrand b/README.debrand deleted file mode 100644 index 01c46d2..0000000 --- a/README.debrand +++ /dev/null @@ -1,2 +0,0 @@ -Warning: This package was configured for automatic debranding, but the changes -failed to apply. diff --git a/SOURCES/dhcp-dhclient_ipv6_prefix.patch b/SOURCES/dhcp-dhclient_ipv6_prefix.patch new file mode 100644 index 0000000..7115f0a --- /dev/null +++ b/SOURCES/dhcp-dhclient_ipv6_prefix.patch @@ -0,0 +1,94 @@ +diff --git a/client/dhc6.c b/client/dhc6.c +index 5460ee1..fe0057c 100644 +--- a/client/dhc6.c ++++ b/client/dhc6.c +@@ -148,6 +148,7 @@ static int dhc6_score_lease(struct client_state *client, + + extern int onetry; + extern int stateless; ++extern int address_prefix_len; + + /* + * Assign DHCPv6 port numbers as a client. +@@ -4364,7 +4365,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 b61da43..05bfc7e 100644 +--- a/client/dhclient.c ++++ b/client/dhclient.c +@@ -114,6 +114,7 @@ char *progname = NULL; + + int bootp_broadcast_always = 0; + ++int address_prefix_len = DHCLIENT_DEFAULT_PREFIX_LEN; + extern struct option *default_requested_options[]; + + void run_stateless(int exit_mode, u_int16_t port); +@@ -192,6 +193,7 @@ usage(const char *sfmt, const char *sarg) + #endif + #else /* DHCPv6 */ + "[-I1dvrxi] [-nw] [-p ] [-D LL|LLT] \n" ++ " [--address-prefix-len length]\n" + #endif /* DHCPv6 */ + " [-s server-addr] [-cf config-file]\n" + " [-df duid-file] [-lf lease-file]\n" +@@ -392,6 +394,17 @@ main(int argc, char **argv) { + tmp->next = client_env; + client_env = tmp; + client_env_count++; ++ } 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]); ++ } + #ifdef DHCPv6 + } else if (!strcmp(argv[i], "-S")) { + if (local_family_set && (local_family == AF_INET)) { +diff --git a/includes/site.h b/includes/site.h +index b2f7fd7..aad9711 100644 +--- a/includes/site.h ++++ b/includes/site.h +@@ -286,7 +286,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 +diff --git a/client/dhclient.c b/client/dhclient.c +index 2f29591..6c8b145 100644 +diff --git a/client/dhclient.c b/client/dhclient.c +index b0bf2bf..f7b1476 100644 +--- a/client/dhclient.c ++++ b/client/dhclient.c +@@ -193,7 +193,6 @@ usage(const char *sfmt, const char *sarg) + #endif + #else /* DHCPv6 */ + "[-I1dvrxi] [-nw] [-p ] [-D LL|LLT] \n" +- " [--address-prefix-len length]\n" + #endif /* DHCPv6 */ + " [-s server-addr] [-cf config-file]\n" + " [-df duid-file] [-lf lease-file]\n" +@@ -202,6 +201,7 @@ usage(const char *sfmt, const char *sarg) + " [-C ] [-B]\n" + " [-H | -F ] [--timeout ]\n" + " [-V ]\n" ++ " [--address-prefix-len length]\n" + " [--request-options ]", + isc_file_basename(progname)); + } diff --git a/SOURCES/dhcp-isc_heap_delete.patch b/SOURCES/dhcp-isc_heap_delete.patch new file mode 100644 index 0000000..3bf1b2b --- /dev/null +++ b/SOURCES/dhcp-isc_heap_delete.patch @@ -0,0 +1,164 @@ +diff --git a/includes/dhcpd.h b/includes/dhcpd.h +index aac2c108..c83dc9a6 100644 +--- a/includes/dhcpd.h ++++ b/includes/dhcpd.h +@@ -1622,8 +1622,9 @@ struct iasubopt { + */ + #define EXPIRED_IPV6_CLEANUP_TIME (60*60) + +- int heap_index; /* index into heap, or -1 +- (internal use only) */ ++ /* index into heaps, or -1 (internal use only) */ ++ int active_index; ++ int inactive_index; + + /* + * A pointer to the state of the ddns update for this lease. +diff --git a/server/mdb6.c b/server/mdb6.c +index 1a728eb3..418ff606 100644 +--- a/server/mdb6.c ++++ b/server/mdb6.c +@@ -216,7 +216,8 @@ iasubopt_allocate(struct iasubopt **iasubopt, const char *file, int line) { + + tmp->refcnt = 1; + tmp->state = FTS_FREE; +- tmp->heap_index = -1; ++ tmp->active_index = -1; ++ tmp->inactive_index = -1; + tmp->plen = 255; + + *iasubopt = tmp; +@@ -604,10 +605,14 @@ lease_older(void *a, void *b) { + * Callback when an address's position in the heap changes. + */ + static void +-lease_index_changed(void *iasubopt, unsigned int new_heap_index) { +- ((struct iasubopt *)iasubopt)-> heap_index = new_heap_index; ++active_changed(void *iasubopt, unsigned int new_heap_index) { ++ ((struct iasubopt *)iasubopt)-> active_index = new_heap_index; + } + ++static void ++inactive_changed(void *iasubopt, unsigned int new_heap_index) { ++ ((struct iasubopt *)iasubopt)-> inactive_index = new_heap_index; ++} + + /*! + * +@@ -660,13 +665,13 @@ ipv6_pool_allocate(struct ipv6_pool **pool, u_int16_t type, + dfree(tmp, file, line); + return ISC_R_NOMEMORY; + } +- if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, lease_index_changed, ++ if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, active_changed, + 0, &(tmp->active_timeouts)) != ISC_R_SUCCESS) { + iasubopt_free_hash_table(&(tmp->leases), file, line); + dfree(tmp, file, line); + return ISC_R_NOMEMORY; + } +- if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, lease_index_changed, ++ if (isc_heap_create(dhcp_gbl_ctx.mctx, lease_older, inactive_changed, + 0, &(tmp->inactive_timeouts)) != ISC_R_SUCCESS) { + isc_heap_destroy(&(tmp->active_timeouts)); + iasubopt_free_hash_table(&(tmp->leases), file, line); +@@ -1361,7 +1366,7 @@ cleanup_lease6(ia_hash_t *ia_table, + * Remove the old lease from the active heap and from the hash table + * then remove the lease from the IA and clean up the IA if necessary. + */ +- isc_heap_delete(pool->active_timeouts, test_iasubopt->heap_index); ++ isc_heap_delete(pool->active_timeouts, test_iasubopt->active_index); + pool->num_active--; + if (pool->ipv6_pond) + pool->ipv6_pond->num_active--; +@@ -1434,7 +1439,7 @@ add_lease6(struct ipv6_pool *pool, struct iasubopt *lease, + if ((test_iasubopt->state == FTS_ACTIVE) || + (test_iasubopt->state == FTS_ABANDONED)) { + isc_heap_delete(pool->active_timeouts, +- test_iasubopt->heap_index); ++ test_iasubopt->active_index); + pool->num_active--; + if (pool->ipv6_pond) + pool->ipv6_pond->num_active--; +@@ -1446,7 +1451,7 @@ add_lease6(struct ipv6_pool *pool, struct iasubopt *lease, + } + } else { + isc_heap_delete(pool->inactive_timeouts, +- test_iasubopt->heap_index); ++ test_iasubopt->inactive_index); + pool->num_inactive--; + } + +@@ -1567,14 +1572,13 @@ lease6_usable(struct iasubopt *lease) { + static isc_result_t + move_lease_to_active(struct ipv6_pool *pool, struct iasubopt *lease) { + isc_result_t insert_result; +- int old_heap_index; + +- old_heap_index = lease->heap_index; + insert_result = isc_heap_insert(pool->active_timeouts, lease); + if (insert_result == ISC_R_SUCCESS) { + iasubopt_hash_add(pool->leases, &lease->addr, + sizeof(lease->addr), lease, MDL); +- isc_heap_delete(pool->inactive_timeouts, old_heap_index); ++ isc_heap_delete(pool->inactive_timeouts, ++ lease->inactive_index); + pool->num_active++; + pool->num_inactive--; + lease->state = FTS_ACTIVE; +@@ -1624,16 +1628,16 @@ renew_lease6(struct ipv6_pool *pool, struct iasubopt *lease) { + if (lease->state == FTS_ACTIVE) { + if (old_end_time <= lease->hard_lifetime_end_time) { + isc_heap_decreased(pool->active_timeouts, +- lease->heap_index); ++ lease->active_index); + } else { + isc_heap_increased(pool->active_timeouts, +- lease->heap_index); ++ lease->active_index); + } + return ISC_R_SUCCESS; + } else if (lease->state == FTS_ABANDONED) { + char tmp_addr[INET6_ADDRSTRLEN]; + lease->state = FTS_ACTIVE; +- isc_heap_increased(pool->active_timeouts, lease->heap_index); ++ isc_heap_increased(pool->active_timeouts, lease->active_index); + log_info("Reclaiming previously abandoned address %s", + inet_ntop(AF_INET6, &(lease->addr), tmp_addr, + sizeof(tmp_addr))); +@@ -1655,9 +1659,7 @@ static isc_result_t + move_lease_to_inactive(struct ipv6_pool *pool, struct iasubopt *lease, + binding_state_t state) { + isc_result_t insert_result; +- int old_heap_index; + +- old_heap_index = lease->heap_index; + insert_result = isc_heap_insert(pool->inactive_timeouts, lease); + if (insert_result == ISC_R_SUCCESS) { + /* +@@ -1708,7 +1710,7 @@ move_lease_to_inactive(struct ipv6_pool *pool, struct iasubopt *lease, + + iasubopt_hash_delete(pool->leases, + &lease->addr, sizeof(lease->addr), MDL); +- isc_heap_delete(pool->active_timeouts, old_heap_index); ++ isc_heap_delete(pool->active_timeouts, lease->active_index); + lease->state = state; + pool->num_active--; + pool->num_inactive++; +@@ -1786,7 +1788,7 @@ decline_lease6(struct ipv6_pool *pool, struct iasubopt *lease) { + pool->ipv6_pond->num_abandoned++; + + lease->hard_lifetime_end_time = MAX_TIME; +- isc_heap_decreased(pool->active_timeouts, lease->heap_index); ++ isc_heap_decreased(pool->active_timeouts, lease->active_index); + return ISC_R_SUCCESS; + } + +@@ -2059,7 +2061,7 @@ cleanup_old_expired(struct ipv6_pool *pool) { + break; + } + +- isc_heap_delete(pool->inactive_timeouts, tmp->heap_index); ++ isc_heap_delete(pool->inactive_timeouts, tmp->inactive_index); + pool->num_inactive--; + + if (tmp->ia != NULL) { diff --git a/SPECS/dhcp.spec b/SPECS/dhcp.spec index 7bbd360..3ed43b8 100644 --- a/SPECS/dhcp.spec +++ b/SPECS/dhcp.spec @@ -16,7 +16,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.3.6 -Release: 30%{?dist} +Release: 34%{?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. @@ -79,6 +79,8 @@ Patch42: dhcp-4.3.6-options_overflow.patch Patch43: dhcp-4.3.6-reference_count_overflow.patch Patch44: dhcp-replay_file_limit.patch Patch45: dhcp-4.2.5-expiry_before_renewal_v2.patch +Patch46: dhcp-dhclient_ipv6_prefix.patch +Patch47: dhcp-isc_heap_delete.patch BuildRequires: autoconf BuildRequires: automake @@ -344,9 +346,10 @@ rm bind/bind.tar.gz # https://bugzilla.redhat.com/show_bug.cgi?id=1647786 %patch45 -p1 -b .t2-expirity -# DHCLIENT_DEFAULT_PREFIX_LEN 64 -> 128 -# https://bugzilla.gnome.org/show_bug.cgi?id=656610 -sed -i -e 's|DHCLIENT_DEFAULT_PREFIX_LEN 64|DHCLIENT_DEFAULT_PREFIX_LEN 128|g' includes/site.h +%patch46 -p1 -b .ipv6-prefix + +# https://bugzilla.redhat.com/show_bug.cgi?id=1704672 +%patch47 -p1 -b .heap-delete # Update paths in all man pages for page in client/dhclient.conf.5 client/dhclient.leases.5 \ @@ -420,7 +423,8 @@ mkdir -p %{buildroot}%{dhcpconfdir}/dhclient.d # NetworkManager dispatcher script mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d install -p -m 0755 %{SOURCE3} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d -install -p -m 0755 %{SOURCE4} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d +## https://bugzilla.redhat.com/show_bug.cgi?id=1685560 +install -p -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d # pm-utils script to handle suspend/resume and dhclient leases install -D -p -m 0755 %{SOURCE5} %{buildroot}%{_libdir}/pm-utils/sleep.d/56dhclient @@ -683,8 +687,16 @@ done %endif %changelog -* Tue May 07 2019 CentOS Sources - 4.3.6-30.el8.centos -- Apply debranding changes +* Mon May 13 2019 Pavel Zhukov - 12:4.3.6-34 +- Resolves: #1704672 - Fix crash caused by bind rebase + +* Fri Mar 29 2019 Pavel Zhukov - 12:4.3.6-33 +- Resolves: #1673946 - Change default prefix length to 128 +- Add address-prefix-lenght option to change default value +- Fix backporting issues + +* Thu Mar 28 2019 Pavel Zhukov - 12:4.3.6-31 +- Resolves: #1685560 - Drop executable flag from NM dispatcher * Mon Dec 17 2018 Pavel Zhukov - 12:4.3.6-30 - Resolves: 1647786 - Recalculate renew time if it's greater than expirity time