Bug 1223530
Summary: | vdsm fails to read dhclient lease config "expire never" | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Marina Kalinin <mkalinin> | |
Component: | vdsm | Assignee: | Ondřej Svoboda <osvoboda> | |
Status: | CLOSED ERRATA | QA Contact: | Meni Yakove <myakove> | |
Severity: | urgent | Docs Contact: | ||
Priority: | urgent | |||
Version: | 3.5.1 | CC: | bazulay, danken, eedri, gprocunier, lpeer, lsurette, mburman, mkalinin, myakove, ssekidde, yeylon, ykaul, ylavi | |
Target Milestone: | ovirt-3.6.0-rc | Keywords: | ZStream | |
Target Release: | 3.6.0 | Flags: | ylavi:
Triaged+
|
|
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1224632 (view as bug list) | Environment: | ||
Last Closed: | 2016-03-09 19:40:15 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | Network | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1224632 |
Description
Marina Kalinin
2015-05-20 19:11:26 UTC
Looking into netinfo.py, I see that parsing the "expire" does not do anything actually - it does not assign the expiration time to anywhere outside this function. So I suggest to completely get rid of that piece of code. And this is also what I am going to suggest to the customer as a test package for now. diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py index 2949a6f..8b9b196 100644 --- a/lib/vdsm/netinfo.py +++ b/lib/vdsm/netinfo.py @@ -631,15 +631,15 @@ def _parseLeaseFile(leaseFile, ipv6): if line.startswith(IFACE) and line.endswith(IFACE_END): name = line[len(IFACE):-len(IFACE_END)] - elif line.startswith(EXPIRE): - end = line.find(';') - if end == -1: - continue # the line should always contain a ; - - expiryTime = _parseExpiryTime(line[len(EXPIRE):end]) - if datetime.utcnow() > expiryTime: - insideLease = False - continue +# elif line.startswith(EXPIRE): +# end = line.find(';') +# if end == -1: +# continue # the line should always contain a ; +# +# expiryTime = _parseExpiryTime(line[len(EXPIRE):end]) +# if datetime.utcnow() > expiryTime: +# insideLease = False +# continue May I ask you for your dhclient version? Currently (as I am travelling) I have limited access to my EL6 host so I only tried to reproduce a bug on Fedora 21, and I failed (probably due to a bug in dhclient). I will try to reproduce on EL6 later. === I was not able to obtain a lease containing "expire never" using dhclient 4.3.1-12.fc21 and dnsmasq 2.72-3.fc21 (with option --dhcp-range=240.0.0.10,240.0.0.100,infinite). The lease contained "expire 0 2151/06/27 13:03:58;" instead, although there is a constant MAX_TIME in dhclient's source that translates to "never". dnsmasq was aware of the option (dnsmasq-dhcp: DHCP, IP range 240.0.0.10 -- 240.0.0.100, lease time infinite). I recorded DHCP communication between dnsmasq and dhclient and in DHCP Offer there was "IP Address Lease Time: (4294967295s) infinity" (interpreted by Wireshark). So it looks like a bug in dhclient (which in turn prevents a bug in VDSM) in Fedora 21. I tried to reproduce on EL6 but again, failed to obtain the lease with "expire never". Assuming that the lease that exposed VDSM's bug was indeed written by dhclient and not altered manually (both of which is unlikely) it seems that I'll have to dig in dhclient sources to understand how to really trigger "expire never". Nevertheless, Dan's quick fix includes and passes a unit test with a lease containing "expire never". Hi Ondrej, Is there still anything required from my side? Simon has provided the dhcp info earlier. How I reproduced it - just by editing all the fails to "never" instead of actual date. And, according to the man pages, never is a valid option. Hi Marina, thanks for the clarification of how you reproduced the bug. "never" is indeed a valid value. All I was after was a way to make dhclient write such a file. When inspecting its code (which uses integer overflow more than I would like) I found no other caveat ("expire" may only contain "never", or a datetime in two formats we already handle). In the future please provide 'Fixed in Version' when moving bugs to ON_QA, thanks. Verified on - 3.6.0-0.0.master.20150519172219.git9a2e2b3.el6.noarch with vdsm-4.17.0-912.git25a063d.el7.noarch and dhclient-4.2.5-36.el7.x86_64 Gil Klein, this bug is covered by the testGetDhclientIfaces unit test (in tests/netinfoTests.py), is this helpful to resolve qe_test_coverage? Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-0362.html |