[dhcp] update address lifetimes on RENEW/RENEW6 (#1032809)

Jiří Popelka jpopelka at fedoraproject.org
Mon Jan 13 12:29:48 UTC 2014


commit 543c1a58140be99fcd528a505ccdee7f4aaec535
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Mon Jan 13 13:28:07 2014 +0100

    update address lifetimes on RENEW/RENEW6 (#1032809)

 dhclient-script |    9 ++++++++-
 dhcp.spec       |    5 ++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/dhclient-script b/dhclient-script
index 2456c3f..322ee6a 100644
--- a/dhclient-script
+++ b/dhclient-script
@@ -3,7 +3,7 @@
 # dhclient-script: Network interface configuration script run by
 #                  dhclient based on DHCP client communication
 #
-# Copyright (C) 2008-2013  Red Hat, Inc.
+# Copyright (C) 2008-2014  Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -483,6 +483,9 @@ dhconfig() {
             fi
         fi
 
+    else # RENEW||REBIND - only update address lifetimes
+        ip -4 addr change ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface} \
+           valid_lft ${new_dhcp_lease_time} preferred_lft ${new_dhcp_lease_time} >/dev/null 2>&1
     fi
 
     if [ ! "${new_ip_address}" = "${alias_ip_address}" ] &&
@@ -601,6 +604,10 @@ dh6config() {
             if [  ! "${new_ip6_address}" = "${old_ip6_address}" ]; then
                 [[ -n "${old_ip6_address}" ]] && ip -6 addr del ${old_ip6_address} dev ${interface}
                 add_ipv6_addr_with_DAD
+            else # only update address lifetimes
+                ip -6 addr change ${new_ip6_address}/${new_ip6_prefixlen} \
+                   dev ${interface} scope global valid_lft ${new_max_life} \
+                                             preferred_lft ${new_preferred_life}
             fi
 
             if [ ! "${new_dhcp6_name_servers}" = "${old_dhcp6_name_servers}" ] ||
diff --git a/dhcp.spec b/dhcp.spec
index 3576105..afc02be 100644
--- a/dhcp.spec
+++ b/dhcp.spec
@@ -18,7 +18,7 @@
 Summary:  Dynamic host configuration protocol software
 Name:     dhcp
 Version:  4.3.0
-Release:  0.2.%{prever}%{?dist}
+Release:  0.3.%{prever}%{?dist}
 # NEVER CHANGE THE EPOCH on this package.  The previous maintainer (prior to
 # dcantrell maintaining the package) made incorrect use of the epoch and
 # that's why it is at 12 now.  It should have never been used, but it was.
@@ -630,6 +630,9 @@ done
 
 
 %changelog
+* Mon Jan 13 2014 Jiri Popelka <jpopelka at redhat.com> - 12:4.3.0-0.3.a1
+- update address lifetimes on RENEW/RENEW6 (#1032809)
+
 * Tue Jan 07 2014 Jiri Popelka <jpopelka at redhat.com> - 12:4.3.0-0.2.a1
 - make it actually build
 


More information about the scm-commits mailing list