Blob Blame History Raw
From 0f89ec314b062a410199251db0356a55b4773173 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 1 Jul 2015 14:57:15 +0200
Subject: [PATCH] network/dhclient-script.sh: make IPv4 DHCP lease time
 optionally

If bootp is used, no lease time is provided in the packet from the bootp
server.
---
 modules.d/40network/dhclient-script.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
index 320208b..a8b5b89 100755
--- a/modules.d/40network/dhclient-script.sh
+++ b/modules.d/40network/dhclient-script.sh
@@ -39,9 +39,9 @@ setup_interface() {
         fi
     fi
 
-    ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} \
-        valid_lft ${lease_time} preferred_lft ${lease_time} \
-        dev $netif
+    ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif \
+        ${lease_time:+valid_lft $lease_time} \
+        ${preferred_lft:+preferred_lft ${preferred_lft}}
 
     if [ -n "$gw" ] ; then
         if [ "$mask" == "255.255.255.255" ] ; then