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