From e3ee5b17e9ffb46b1476ef97f532d6b81f2615dc Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Nov 21 2013 13:52:30 +0000 Subject: dhclient-script: set address lifetimes (#1032809) --- diff --git a/dhclient-script b/dhclient-script index 41fd26f..2456c3f 100644 --- a/dhclient-script +++ b/dhclient-script @@ -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 diff --git a/dhcp.spec b/dhcp.spec index 0ef4fc4..1926fa1 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -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 - 12:4.2.5-28 +- dhclient-script: set address lifetimes (#1032809) + * Thu Nov 14 2013 Jiri Popelka - 12:4.2.5-27 - dhclient-script(RENEW6|REBIND6): delete old ip6_address if it changed (#1015729)