Bug 55348 - dhcpcd obtains invalid lease upon restart
dhcpcd obtains invalid lease upon restart
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: dhcpcd (Show other bugs)
7.2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Elliot Lee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-10-29 19:54 EST by Patrick J. LoPresti
Modified: 2007-04-18 12:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-28 13:08:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Patrick J. LoPresti 2001-10-29 19:54:41 EST
Description of Problem:
If you restart dhcpcd, it obtains a new lease with a negative lease time.

How Reproducible:
Completely.

Steps to Reproduce:
1. Boot a Red Hat 7.2 system which uses dhcpcd to obtain an IP
address.  Examine the /var/state/dhcp/dhcpd.leases file on the DHCP
server to see that the lease looks good.
2. Reboot the system, or just do "/etc/rc.d/init.d/network restart".
3. Look at dhcpd.leases again, remembering that the *last* entry for
any particular lease is the operative one.  Observe that the lease
expires before it was issued.

Actual Results:
The second lease expires before it was issued.

Expected Results:
The second lease should expire at the same time or later than the
first lease.

Additional Information:
If you do "/etc/rc.d/init.d/network stop", then "rm -f /etc/dhcpc/*",
then "/etc/rc.d/init.d/network start", the new lease is correct.  So
this has something to do with dhcpcd's use of its state files when
obtaining a lease.

Our DHCP server is Red Hat 6.2, using the dhcp-2.0-3 RPM.  It has been
serving leases flawlessly for years to 250+ machines of various
operating systems, so I highly suspect this is a problem with the
dhcpcd client.

Note that the DHCP server really does think the lease has expired, and
it is willing to hand out the same IP address to another machine.
This is bad enough that I consider this a "High" severity bug.

Let me know if you require additional information.
Comment 1 Dan Anderson 2001-10-30 03:16:11 EST
This happened to me too.  I upgraded from RH 7.1 to RH 7.2.
Everything worked perfectly after the upgrade.
I didn't reboot, but restarted all the daemons by hand to make sure things were
going OK.

THEN I REBOOTED.

The system (RH 7.2) hung during booting at this message:
Bringing up interface eth0

Then I booted single user  and did a "init 3".
It still hung.  I broke out of it and reran the "/etc/init.d/network start"
command.  It worked.  Looking further, I see the /etc/init.d/network
startup script hangs at this command:

/sbin/dhcpcd -n eth0

I edited the /etc/sysconfig/network-scripts/ifcfg-eth0 script and disabled
dhcp and enabled static IP addresses.  I can do this as I have a
Linksys DSL router/firewall.  If you can't use static IP addresses
(say because your ISP won't give them one to you), I do NOT recommend
upgrading to RedHat 7.2, at least yet.

If I run "/etc/init.d/network start", then type cntl-c and run it 
(/etc/init.d/network start) again, it works
(i.e., eth0 is configured and I can ping and so on).
Comment 2 Olivier Baudron 2001-12-29 16:56:04 EST
For the lease time bug, I think the problem is on the dhcp server side.
/etc/dhcpc/dhcpcd-*.cache is only used by dhcpcd to remember the IP adress and
ask for the same one if the PC reboots. Also, there is no notion of absolute
time in dhcpcd. As is said in rfc 2131, the client may ask for a lease time,
represented by an _unsigned_ int (0xffffffff means infinite). So, if the server
assigns an expiration lease time in the past, there is a problem with it.
Comment 3 Elliot Lee 2002-01-04 14:50:35 EST
If you would care to try some solutions, you can rebuild dhcp-3.0-3 or
dhcpcd-1.3.21pl2-1 from rawhide...
Comment 4 Jason Gilbert 2002-02-14 17:44:06 EST
<i>As is said in rfc 2131, the client may ask for a lease time,
represented by an _unsigned_ int (0xffffffff means infinite). So, if the server
assigns an expiration lease time in the past, there is a problem with it.
</i>

This is what I assumed.  Most likely your server does not have a
default-lease-time or max-lease-time configured.  dhcpcd must have been changed
to not request a lease time or an infinite lease.  Adding both of these options
worked for me.

I noticed this because I had a script that was updating DNS and wasn't adding
7.2 machines anymore.  I assume the script thought the infinite leases were
actually expired leases.

Works for me now.

jason

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