Blame SOURCES/0154-network-DCHPv6-set-valid_lft-and-preferred_lft.patch

a56a5e
From 69acbc47356b56a03a331b8be57ed83af2687c8d Mon Sep 17 00:00:00 2001
966cef
From: Harald Hoyer <harald@redhat.com>
966cef
Date: Thu, 27 Mar 2014 12:31:23 +0100
966cef
Subject: [PATCH] network: DCHPv6: set valid_lft and preferred_lft
966cef
966cef
https://bugzilla.redhat.com/show_bug.cgi?id=1064365
966cef
---
966cef
 modules.d/40network/dhclient-script.sh | 10 +++++++---
966cef
 1 file changed, 7 insertions(+), 3 deletions(-)
966cef
966cef
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
966cef
index 50e8932..ba05250 100755
966cef
--- a/modules.d/40network/dhclient-script.sh
966cef
+++ b/modules.d/40network/dhclient-script.sh
966cef
@@ -64,13 +64,17 @@ setup_interface6() {
966cef
     search=$(printf -- "$new_domain_search")
966cef
     namesrv=$new_domain_name_servers
966cef
     hostname=$new_host_name
966cef
-    lease_time=$new_dhcp_lease_time
966cef
+    [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
966cef
+    [ -n "$new_max_life" ] && lease_time=$new_max_life
966cef
+    preferred_lft=$lease_time
966cef
+    [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
966cef
 
966cef
     [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
966cef
 
966cef
     ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
966cef
-        dev ${netif} scope global valid_lft ${lease_time} \
966cef
-        preferred_lft ${lease_time}
966cef
+        dev ${netif} scope global \
966cef
+        ${lease_time:+valid_lft $lease_time} \
966cef
+        ${preferred_lft:+preferred_lft ${preferred_lft}}
966cef
 
966cef
     [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
966cef
     if  [ -n "$namesrv" ] ; then