remove inherit-leases.patch - it's probably not needed anymore (#815355)

This commit is contained in:
Jiri Popelka 2012-04-26 14:45:26 +02:00
parent b2ce0ea4b3
commit 634087ae6d
3 changed files with 9 additions and 49 deletions

View File

@ -349,7 +349,7 @@ dhconfig() {
[ ! "${old_broadcast_address}" = "${new_broadcast_address}" ] || [ ! "${old_broadcast_address}" = "${new_broadcast_address}" ] ||
[ ! "${old_routers}" = "${new_routers}" ] || [ ! "${old_routers}" = "${new_routers}" ] ||
[ ! "${old_interface_mtu}" = "${new_interface_mtu}" ]; then [ ! "${old_interface_mtu}" = "${new_interface_mtu}" ]; then
ip -4 addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} ip -4 addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} >/dev/null 2>&1
ip link set dev ${interface} up ip link set dev ${interface} up
# The 576 MTU is only used for X.25 and dialup connections # The 576 MTU is only used for X.25 and dialup connections
@ -358,7 +358,7 @@ dhconfig() {
# disallow MTUs from 576 and below by default, so that broken # disallow MTUs from 576 and below by default, so that broken
# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc). # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
if [ -n "${new_interface_mtu}" ] && [ ${new_interface_mtu} -gt 576 ]; then if [ -n "${new_interface_mtu}" ] && [ ${new_interface_mtu} -gt 576 ]; then
ip link set ${interface} mtu ${new_interface_mtu} ip link set dev ${interface} mtu ${new_interface_mtu}
fi fi
if [ -x ${ETCDIR}/dhclient-${interface}-up-hooks ]; then if [ -x ${ETCDIR}/dhclient-${interface}-up-hooks ]; then
@ -661,14 +661,9 @@ case "${reason}" in
ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1 ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1
fi fi
if [ "${keep_old_ip}" = "yes" ]; then ip link set dev ${interface} up
ip link set ${interface} up
else
ip -4 addr flush dev ${interface} >/dev/null 2>&1
ip link set ${interface} up
fi
if [ -n "${DHCLIENT_DELAY}" ] && [ ${DHCLIENT_DELAY} -gt 0 ]; then if [ -n "${DHCLIENT_DELAY}" ] && [ ${DHCLIENT_DELAY} -gt 0 ]; then
# We need to give the kernel some time to get the interface up.
sleep ${DHCLIENT_DELAY} sleep ${DHCLIENT_DELAY}
fi fi
@ -677,7 +672,7 @@ case "${reason}" in
PREINIT6) PREINIT6)
# ensure interface is up # ensure interface is up
ip link set ${interface} up ip link set dev ${interface} up
# remove any stale addresses from aborted clients # remove any stale addresses from aborted clients
ip -6 addr flush dev ${interface} scope global permanent ip -6 addr flush dev ${interface} scope global permanent

View File

@ -1,34 +0,0 @@
diff -up dhcp-4.2.0/client/dhclient.c.inherit dhcp-4.2.0/client/dhclient.c
--- dhcp-4.2.0/client/dhclient.c.inherit 2010-07-21 14:33:44.000000000 +0200
+++ dhcp-4.2.0/client/dhclient.c 2010-07-21 14:40:05.000000000 +0200
@@ -2322,6 +2322,7 @@ void send_request (cpp)
{
struct client_state *client = cpp;
+ int i;
int result;
int interval;
struct sockaddr_in destination;
@@ -2381,6 +2382,22 @@ void send_request (cpp)
/* Now do a preinit on the interface so that we can
discover a new address. */
script_init (client, "PREINIT", (struct string_list *)0);
+
+ /* Has an active lease */
+ if (client -> interface -> addresses != NULL) {
+ for (i = 0; i < client -> interface -> address_count; i++) {
+ if (client -> active &&
+ client -> active -> is_bootp &&
+ client -> active -> expiry > cur_time &&
+ client -> interface -> addresses[i].s_addr != 0 &&
+ client -> active -> address.len == 4 &&
+ memcpy (client -> active -> address.iabuf, &(client -> interface -> addresses[i]), 4) == 0) {
+ client_envadd (client, "", "keep_old_ip", "%s", "yes");
+ break;
+ }
+ }
+ }
+
if (client -> alias)
script_write_params (client, "alias_",
client -> alias);

View File

@ -19,7 +19,7 @@
Summary: Dynamic host configuration protocol software Summary: Dynamic host configuration protocol software
Name: dhcp Name: dhcp
Version: 4.2.4 Version: 4.2.4
Release: 0.2.%{prever}%{?dist} Release: 0.3.%{prever}%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and # 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. # that's why it is at 12 now. It should have never been used, but it was.
@ -48,7 +48,6 @@ Patch8: dhcp-4.2.2-xen-checksum.patch
Patch10: dhcp-4.2.1-manpages.patch Patch10: dhcp-4.2.1-manpages.patch
Patch11: dhcp-4.2.4-paths.patch Patch11: dhcp-4.2.4-paths.patch
Patch12: dhcp-4.2.2-CLOEXEC.patch Patch12: dhcp-4.2.2-CLOEXEC.patch
Patch13: dhcp-4.2.0-inherit-leases.patch
Patch14: dhcp-4.2.0-garbage-chars.patch Patch14: dhcp-4.2.0-garbage-chars.patch
Patch15: dhcp-4.2.0-missing-ipv6-not-fatal.patch Patch15: dhcp-4.2.0-missing-ipv6-not-fatal.patch
Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch
@ -213,9 +212,6 @@ rm bind/bind.tar.gz
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19148]) # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19148])
%patch12 -p1 -b .cloexec %patch12 -p1 -b .cloexec
# If we have an active lease, do not down the interface (#453982)
%patch13 -p1 -b .inherit
# Fix 'garbage in format string' error (#450042) # Fix 'garbage in format string' error (#450042)
%patch14 -p1 -b .garbage %patch14 -p1 -b .garbage
@ -604,6 +600,9 @@ fi
%changelog %changelog
* Thu Apr 26 2012 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.4-0.3.b1
- remove inherit-leases.patch - it's probably not needed anymore (#815355)
* Wed Apr 18 2012 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.4-0.2.b1 * Wed Apr 18 2012 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.4-0.2.b1
- update paths.patch and source URL - update paths.patch and source URL