Blame SOURCES/0252-network-dhclient-script.sh-add-RENEW-REBIND.patch

18971c
From efe5301ab91a0e871f2c68faf1f835f306388690 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Wed, 1 Jul 2015 14:53:33 +0200
18971c
Subject: [PATCH] network/dhclient-script.sh: add RENEW/REBIND
18971c
18971c
(cherry picked from commit cf627b20d039c527f4de167e38978d4984e4d727)
18971c
---
18971c
 modules.d/40network/dhclient-script.sh | 23 +++++++++++++++++++++++
18971c
 1 file changed, 23 insertions(+)
18971c
18971c
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
18971c
index aef94d6c..d96f7d94 100755
18971c
--- a/modules.d/40network/dhclient-script.sh
18971c
+++ b/modules.d/40network/dhclient-script.sh
18971c
@@ -131,6 +131,17 @@ case $reason in
18971c
         >/tmp/net.$netif.up
18971c
         ;;
18971c
 
18971c
+    RENEW|REBIND)
18971c
+        unset 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
+        ip -4 addr change ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} \
18971c
+           ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
18971c
+           >/dev/null 2>&1
18971c
+        ;;
18971c
+
18971c
     BOUND6)
18971c
         echo "dhcp: BOND6 setting $netif"
18971c
         setup_interface6
18971c
@@ -151,6 +162,18 @@ case $reason in
18971c
         echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
18971c
         >/tmp/net.$netif.up
18971c
         ;;
18971c
+
18971c
+    RENEW6|REBIND6)
18971c
+        unset 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
+        ip -6 addr change ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} scope global \
18971c
+           ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
18971c
+           >/dev/null 2>&1
18971c
+        ;;
18971c
+
18971c
     *) echo "dhcp: $reason";;
18971c
 esac
18971c