Blame SOURCES/0097-network-dhclient-script.sh-set-lease-time.patch

712866
From ade113d75b07ba294facbe943b859624fa45efb9 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Tue, 28 Jan 2014 12:12:43 +0100
712866
Subject: [PATCH] network/dhclient-script.sh: set lease time
712866
712866
The dracut dhclient-script.sh should set address lifetimes to the DHCP
712866
lease time, so that other stuff (like NetworkManager!) knows that the
712866
address is temporary and was created by DHCP.
712866
712866
https://bugzilla.redhat.com/show_bug.cgi?id=1058519
712866
---
712866
 modules.d/40network/dhclient-script.sh | 5 ++++-
712866
 1 file changed, 4 insertions(+), 1 deletion(-)
712866
712866
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
712866
index 07c3d9b..70a2b71 100755
712866
--- a/modules.d/40network/dhclient-script.sh
712866
+++ b/modules.d/40network/dhclient-script.sh
712866
@@ -12,6 +12,7 @@ setup_interface() {
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
 
712866
     [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
712866
 
712866
@@ -29,7 +30,9 @@ setup_interface() {
712866
         fi
712866
     fi
712866
 
712866
-    ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif
712866
+    ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} \
712866
+        valid_lft ${lease_time} preferred_lft ${lease_time} \
712866
+        dev $netif
712866
 
712866
     [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
712866