RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1058519 - Should set address lifetimes in dhclient-script.sh
Summary: Should set address lifetimes in dhclient-script.sh
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dracut
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: dracut-maint
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1050914
TreeView+ depends on / blocked
 
Reported: 2014-01-28 00:41 UTC by Dan Williams
Modified: 2014-06-18 03:57 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:38:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dan Williams 2014-01-28 00:41:12 UTC
Similar to bug 1032809 (for dhclient) the dracut dhclient-script.sh should set address lifetimes to the DHCP lease time, so that other stuff (like NetworkManager!) knows that the address is temporary and was created by DHCP.  

This should be as simple as something like this (untested):

diff -up dracut-034/modules.d/40network/dhclient-script.sh.foo dracut-034/modules.d/40network/dhclient-script.sh
--- dracut-034/modules.d/40network/dhclient-script.sh.foo	2014-01-27 18:36:33.965704565 -0600
+++ dracut-034/modules.d/40network/dhclient-script.sh	2014-01-27 18:40:04.528072174 -0600
@@ -12,6 +12,7 @@ setup_interface() {
     search=$(printf -- "$new_domain_search")
     namesrv=$new_domain_name_servers
     hostname=$new_host_name
+    lease_time=$new_dhcp_lease_time
 
     [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
 
@@ -29,7 +30,9 @@ setup_interface() {
         fi
     fi
 
-    ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif
+    ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} \
+        valid_lft ${lease_time} preferred_lft ${lease_time} \
+        dev $netif
 
     [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
 

and will result in 'ip addr' showing the correct valid_lft and preferred_lft instead of "forever", which they clearly are not valid for.

Thanks!

Comment 3 Ladislav Jozsa 2014-02-21 13:42:47 UTC
Verified with dracut-033-124.el7, RHEL-7.0-20140220.2. Kernel lifetimes are correctly set in dracut environment.

Comment 4 Ludek Smid 2014-06-13 11:38:47 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.