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

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