dhclient-script: set address lifetimes (#1032809)

This commit is contained in:
Jiri Popelka 2013-11-21 14:52:30 +01:00
parent e220d8e06b
commit e3ee5b17e9
2 changed files with 11 additions and 4 deletions

View File

@ -354,7 +354,8 @@ dhconfig() {
[ ! "${old_broadcast_address}" = "${new_broadcast_address}" ] ||
[ ! "${old_routers}" = "${new_routers}" ] ||
[ ! "${old_interface_mtu}" = "${new_interface_mtu}" ]; then
ip -4 addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} >/dev/null 2>&1
ip -4 addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} \
valid_lft ${new_dhcp_lease_time} preferred_lft ${new_dhcp_lease_time} >/dev/null 2>&1
ip link set dev ${interface} up
# The 576 MTU is only used for X.25 and dialup connections
@ -546,7 +547,8 @@ dhconfig() {
# using that address for traffic.
add_ipv6_addr_with_DAD() {
ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
dev ${interface} scope global
dev ${interface} scope global valid_lft ${new_max_life} \
preferred_lft ${new_preferred_life}
# repeatedly test whether newly added address passed
# duplicate address detection (DAD)
@ -770,7 +772,9 @@ case "${reason}" in
ip -4 addr flush dev ${interface} label ${interface}:0 >/dev/null 2>&1
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} \
valid_lft ${new_dhcp_lease_time} preferred_lft ${new_dhcp_lease_time}
set ${new_routers}
if ping -q -c 1 -w 10 -I ${interface} ${1}; then

View File

@ -18,7 +18,7 @@
Summary: Dynamic host configuration protocol software
Name: dhcp
Version: 4.2.5
Release: 27%{?dist}
Release: 28%{?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.
@ -641,6 +641,9 @@ done
%changelog
* Thu Nov 21 2013 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.5-28
- dhclient-script: set address lifetimes (#1032809)
* Thu Nov 14 2013 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.5-27
- dhclient-script(RENEW6|REBIND6): delete old ip6_address if it changed (#1015729)