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 1032809 - dhclient-script: set address lifetimes
Summary: dhclient-script: set address lifetimes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dhcp
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Popelka
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-20 21:53 UTC by Dan Williams
Modified: 2014-06-18 00:38 UTC (History)
7 users (show)

Fixed In Version: dhcp-4.2.5-26.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:10:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Assign lease time to addresses added by dhclient-script (2.83 KB, patch)
2013-11-20 21:53 UTC, Dan Williams
no flags Details | Diff
Assign lease time to addresses added by dhclient-script (1.81 KB, patch)
2013-11-21 13:43 UTC, Jiri Popelka
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1046405 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Bugzilla 1046517 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 1046405 1046517

Description Dan Williams 2013-11-20 21:53:42 UTC
Created attachment 826866 [details]
Assign lease time to addresses added by dhclient-script

dhclient-script should utilize the new 'lifetime' options of iproute2 3.11+ to set the lifetimes of any addresse it adds to the duration of the lease time.  This is correct (the address should not live longer than the lease, especially if dhclient crashes) and also allows other programs (like NetworkManager) to know that the address is not a statically configured address.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1031763#c15 in which NM cannot recognize that the address was added by dhclient.

It might be as easy as using "new_dhcp_lease_time" as the argument for valid & preferred times for /sbin/ip when adding addresses, since both are in seconds.  The attached patch seems to do the trick for me, though of course more testing is required.

Comment 2 Pavel Šimerda (pavlix) 2013-11-20 22:41:25 UTC
+1

We came up with this idea October 2012 in Westford and it was nice to see this happening in kernel, iproute2 and NetworkManager already. Just a sidenote for Dan, before I changed the team, I also kept route lifetimes on my personal TODO list. That would allow you to distinguish static routes from dynamic ones, even for default route where it might be especially useful. Maybe we could prepare dhclient for that as well?

Comment 3 Jiri Popelka 2013-11-21 13:43:53 UTC
Created attachment 827184 [details]
Assign lease time to addresses added by dhclient-script

(In reply to Dan Williams from comment #0)
> It might be as easy as using "new_dhcp_lease_time" as the argument for valid
> & preferred times for /sbin/ip when adding addresses, since both are in
> seconds.  The attached patch seems to do the trick for me, though of course
> more testing is required.

Yes, that looks good - for 'dhclient -4'. For 'dhclient -6' it's even easier because there are 2 values: new_max_life & new_preferred_life which have the same meaning as /sbin/ip's valid_lft & preferred_lft.

Comment 4 Dan Williams 2013-11-21 15:52:57 UTC
(In reply to Pavel Šimerda from comment #2)
> +1
> 
> We came up with this idea October 2012 in Westford and it was nice to see
> this happening in kernel, iproute2 and NetworkManager already. Just a
> sidenote for Dan, before I changed the team, I also kept route lifetimes on
> my personal TODO list. That would allow you to distinguish static routes
> from dynamic ones, even for default route where it might be especially
> useful. Maybe we could prepare dhclient for that as well?

Yeah, that would be useful too.  Though when looking into this yesterday, I didn't find any iproute2 options for route lifetimes, so I guess this would have to wait for iproute2.

Comment 7 Vlad Yasevich 2014-01-10 17:52:22 UTC
Hi Jiri

I've traced the cause of Bug 1046405 and Bug 1046517 to this change.

The problem displays itself as address going away from the interface
while the interface is running.

Tracing the kernel shows the address is timed out by the kernel because
its lifetime has expired.  Looking the script, the lifetime is only updated
when REBIND happens, but that's not a normal operation.  In normal circumstances,
we have a RENEW operation on which the lifetime is not updated.  In the end,
the even though the lease has been extended via RENEW, the kernel address lifetimes have not changed since the original and the address is cleaned-up.

This is really noticeable when the leases are short, but I don't have the
infrastructure to test.  Can you please take a look.

Thanks
-vlad

Comment 8 Jiri Popelka 2014-01-13 11:24:38 UTC
Thank you for the investigation Vlad, you are right.
We set the lifetimes when we add the address, but don't touch it later during RENEW - this needs to be changed.

Comment 12 Ladislav Jozsa 2014-02-11 09:23:32 UTC
Verified on dhclient-4.2.5-26.el7, kernel address's lifetime is properly set.

Comment 13 Ludek Smid 2014-06-13 11:10:16 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.