dhclient-script: address alias fixes (#741786)
This commit is contained in:
parent
1e3f54a9ec
commit
5c5bbc0b1a
@ -333,7 +333,7 @@ dhconfig() {
|
|||||||
if [ -n "${old_ip_address}" ] && [ -n "${alias_ip_address}" ] &&
|
if [ -n "${old_ip_address}" ] && [ -n "${alias_ip_address}" ] &&
|
||||||
[ ! "${alias_ip_address}" = "${old_ip_address}" ]; then
|
[ ! "${alias_ip_address}" = "${old_ip_address}" ]; then
|
||||||
# possible new alias, remove old alias first
|
# possible new alias, remove old alias first
|
||||||
ip -4 addr del ${old_ip_address} dev ${interface}:0
|
ip -4 addr del ${old_ip_address} dev ${interface} label ${interface}:0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${old_ip_address}" ] &&
|
if [ -n "${old_ip_address}" ] &&
|
||||||
@ -479,9 +479,10 @@ dhconfig() {
|
|||||||
|
|
||||||
if [ ! "${new_ip_address}" = "${alias_ip_address}" ] &&
|
if [ ! "${new_ip_address}" = "${alias_ip_address}" ] &&
|
||||||
[ -n "${alias_ip_address}" ]; then
|
[ -n "${alias_ip_address}" ]; then
|
||||||
ip -4 addr flush dev ${interface}:0 >/dev/null 2>&1
|
# Reset the alias address (fix: this should really only do this on changes)
|
||||||
ip -4 addr add ${alias_ip_address}/${alias_prefix} dev ${interface}:0
|
ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1
|
||||||
ip -4 route replace ${alias_ip_address}/32 dev ${interface}:0
|
ip -4 addr add ${alias_ip_address}/${alias_prefix} broadcast ${alias_broadcast_address} dev ${interface} label ${interface}:0
|
||||||
|
ip -4 route replace ${alias_ip_address}/32 dev ${interface}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make_resolv_conf
|
make_resolv_conf
|
||||||
@ -648,8 +649,8 @@ case "${reason}" in
|
|||||||
|
|
||||||
PREINIT)
|
PREINIT)
|
||||||
if [ -n "${alias_ip_address}" ]; then
|
if [ -n "${alias_ip_address}" ]; then
|
||||||
# Bring down alias interface, its routes will disappear too.
|
# Flush alias, its routes will disappear too.
|
||||||
ip link set ${interface}:0 down
|
ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${keep_old_ip}" = "yes" ]; then
|
if [ "${keep_old_ip}" = "yes" ]; then
|
||||||
@ -724,8 +725,8 @@ case "${reason}" in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${alias_ip_address}" ]; then
|
if [ -n "${alias_ip_address}" ]; then
|
||||||
# Turn off alias interface
|
# Flush alias
|
||||||
ip link set ${interface}:0 down
|
ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${old_ip_address}" ]; then
|
if [ -n "${old_ip_address}" ]; then
|
||||||
@ -734,8 +735,8 @@ case "${reason}" in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${alias_ip_address}" ]; then
|
if [ -n "${alias_ip_address}" ]; then
|
||||||
ip -4 addr add ${alias_ip_address}/${alias_prefix} dev ${interface}:0
|
ip -4 addr add ${alias_ip_address}/${alias_prefix} broadcast ${alias_broadcast_address} dev ${interface} label ${interface}:0
|
||||||
ip -4 route replace ${alias_ip_address}/32 ${interface}:0
|
ip -4 route replace ${alias_ip_address}/32 dev ${interface}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
@ -744,7 +745,7 @@ case "${reason}" in
|
|||||||
TIMEOUT)
|
TIMEOUT)
|
||||||
if [ -n "${new_routers}" ]; then
|
if [ -n "${new_routers}" ]; then
|
||||||
if [ -n "${alias_ip_address}" ]; then
|
if [ -n "${alias_ip_address}" ]; then
|
||||||
ip -4 addr flush dev ${interface}:0 >/dev/null 2>&1
|
ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
Summary: Dynamic host configuration protocol software
|
Summary: Dynamic host configuration protocol software
|
||||||
Name: dhcp
|
Name: dhcp
|
||||||
Version: 4.2.2
|
Version: 4.2.2
|
||||||
Release: 9%{?dist}
|
Release: 10%{?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.
|
||||||
@ -657,6 +657,9 @@ fi
|
|||||||
%{_initddir}/dhcrelay
|
%{_initddir}/dhcrelay
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Sep 29 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.2-10
|
||||||
|
- dhclient-script: address alias handling fixes from Scott Shambarger (#741786)
|
||||||
|
|
||||||
* Thu Sep 22 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.2-9
|
* Thu Sep 22 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.2-9
|
||||||
- dhclient-script: do not backup&restore /etc/resolv.conf and /etc/localtime.
|
- dhclient-script: do not backup&restore /etc/resolv.conf and /etc/localtime.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user