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

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