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

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