Bug 62948 - dhcp lease infinite
dhcp lease infinite
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: dhcp (Show other bugs)
7.3
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Elliot Lee
:
: 62949 71662 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-08 06:47 EDT by Thomas M Steenholdt
Modified: 2008-05-01 11:38 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-08-17 17:00:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
DHCP Daemon Configuration File (from the server :)) (265 bytes, text/plain)
2002-06-11 15:42 EDT, Thomas M Steenholdt
no flags Details
trace conducted from the client - using the proposed procedure (Both Server/Client are RH7.3) (4.25 KB, text/plain)
2002-06-11 15:45 EDT, Thomas M Steenholdt
no flags Details
dhcpd stats taken from the server after the trace was performed - the trace leads to this result (563 bytes, text/plain)
2002-06-11 15:47 EDT, Thomas M Steenholdt
no flags Details

  None (edit)
Description Thomas M Steenholdt 2002-04-08 06:47:38 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.9) Gecko/20020311

Description of problem:
for some reason, using dhcp configuration results in an infinite lease on my
dhcp server(RH7.2 i586). I'm not sure whether this is a client or server
problem. default-lease-time and max-lease-time options have been set. With a
RH7.2 client this would also happen, but it seemed that setting the
DHCP_HOSTNAME in ifcfg-eth0 made the lease more correct. This does not seem to
be the case on skipjack. Windows clients result in correct leases on the server.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Enable DHCP on an interface
2. Restart networking

	

Actual Results:  on the server, examining the /var/lib/dhcp/dhcp.leases, the new
entry for the test-client shows an end time 1 second before the start time

Expected Results:  on the server, examining the /var/lib/dhcp/dhcp.leases, the
new entry for the test-client should show an end time <default-lease-time> after
start time.

Additional info:

As noted above I'm not entirely sure where the problem lies. This could easily
be a server problem or maybe even a configuration problem - But nothing I've
tried has made it go away for good!
Comment 1 Thomas M Steenholdt 2002-04-08 07:33:43 EDT
*** Bug 62949 has been marked as a duplicate of this bug. ***
Comment 2 Barry K. Nathan 2002-04-15 07:52:09 EDT
I'm seeing this too, but it's sporadic. Sometimes my leases are 20 minutes or so
(this is the lease time on my DHCP server) and sometimes they're about 24 hours
(this is what I've configured my server to use for *BOOTP* leases!). Note that
the ISC DHCP server implementation defaults to infinite length leases for BOOTP
clients... (BTW, I'm running Slackware 8.0 on my server, which comes with ISC
dhcpd 2.1pl5.)

I never saw this with RH 7.2 or earlier, but OTOH I only enabled BOOTP support
on my DHCP server a few days back.

Comment 3 Thomas M Steenholdt 2002-04-15 08:06:34 EDT
I have "deny bootp;" in my dhcpd.conf file, but I doesn't seem to help my
problem any!
Comment 4 Elliot Lee 2002-04-15 12:25:07 EDT
Hmm, it seems to me that it would be valuable to narrow this down to a
client-side vs. server-side problem. Does anyone know whether it is possible to
make the problem go away by changing either the server or client? Has there been
any platform that does not exhibit this problem?
Comment 5 Thomas M Steenholdt 2002-04-15 13:06:06 EDT
My wife's Windows Xp client, seems to always result in a correct lease length of
<default-lease-time> on my RH7.2 DHCP server, so it seems to me, the client is
the "guilty one"
Comment 6 Thomas M Steenholdt 2002-05-08 06:44:39 EDT
Nothing has changed, in relation to this bug, in RH 7.3

Comment 7 Olivier Baudron 2002-06-11 12:48:40 EDT
Can someone attach his dhcpd.conf and the debugging infos given by tcpdump on
the client side:

# /etc/init.d/network stop
# ifconfig eth0 up
# tcpdump -n -i eth0 -s 2000 -X port 67
# dhcpcd

Please, use the latest version of dhcpcd and dhcp (or at least Redhat 7.3).
I will investigate on this. -- Thanks.
Comment 8 Thomas M Steenholdt 2002-06-11 15:42:59 EDT
Created attachment 60565 [details]
DHCP Daemon Configuration File (from the server :))
Comment 9 Thomas M Steenholdt 2002-06-11 15:45:03 EDT
Created attachment 60566 [details]
trace conducted from the client - using the proposed procedure (Both Server/Client are RH7.3)
Comment 10 Thomas M Steenholdt 2002-06-11 15:47:08 EDT
Created attachment 60567 [details]
dhcpd stats taken from the server after the trace was performed - the trace leads to this result
Comment 11 Olivier Baudron 2002-06-11 16:21:03 EDT
Thanks, got it!

This is a server problem. At first, the client asks for an infinite lease time.
The special value for this is -1. Then the server executes:

dhcp.c:752
    /* Don't let the client ask for a longer lease than
    is supported for this subnet or host. */
    if (lease_time > max_lease_time)
        lease_time = max_lease_time;

But, since lease_time==-1, lease_time is not set to the upper bound
max_lease_time. And the server bug is there. Finally, it reads:

    state -> offered_expiry = cur_time + lease_time;

which explains why the server logs give an expired lease time 1s in the past.

Can you try rawhide version (dhcp-3.0-7)? I had a quick look at it, and think
this bug should be fixed.

Note (for your wife;)): Windoze clients don't ask for an infinite lease time by
default, which is why the server works with it. But this is really a server
problem.
Comment 12 Olivier Baudron 2002-06-11 16:53:24 EDT
patch for RedHat 7.3:

--- dhcp-2.0pl5/server/dhcp.c   2000-06-30 21:04:52.000000000 +0200
+++ dhcp-2.0pl5/server/dhcp.c   2002-06-11 22:31:28.000000000 +0200
@@ -751,7 +751,8 @@
 
                        /* Don't let the client ask for a longer lease than
                           is supported for this subnet or host. */
-                       if (lease_time > max_lease_time)
+                       if ((lease_time > max_lease_time) ||
+                           (lease_time == -1))
                                lease_time = max_lease_time;
                } else
                        lease_time = default_lease_time;
Comment 13 Olivier Baudron 2002-06-11 18:48:51 EDT
Yes, this is indeed fixed in rawhide.
Comment 14 Elliot Lee 2002-06-11 19:37:00 EDT
Olivier deserves a trophy for tracking this down :)
Comment 15 Thomas M Steenholdt 2002-06-12 09:35:50 EDT
While we're at it... How is this supposed to work when a client request a lease
time > default_lease_time but < max_lease_time... If that scenario is handled in
the same wad of code descriped above, and the proposed lease length should be
ack'ed... It probably needs a few more changes - perhaps something like this...

if ((lease_time > max_lease_time) || (lease_time == -1)){
  lease_time = max_lease_time;
}
else 
if (lease_time < default_lease_time) lease_time = default_lease_time;

this would allow a lease time of 3 days to be proposed, where default_lease_time
is 2 days and max_lease_time is 5 days.

i'm sorry - i haven't had a look at the complete source code so it might be
handled elsewhere...
Comment 16 Olivier Baudron 2002-06-12 10:40:29 EDT
To Tmus: Don't worry, everything else is correct. The algorithm is:
- if the client does not request a lease time: set lease to default_lease_time
- else: bound the requested lease time with max_lease_time
If for some reasons the client requests a shorter lease time than the default
one, he receives what he wants!

To Elliot: You might consider publish an RH7.3 update for dhcp since:
- most people use official releases only
- dhcp in rawhide is a major version upgrade (2->3)
- the fix is trivial ;)
Comment 17 Thomas M Steenholdt 2002-06-13 00:30:02 EDT
Just to comfirm that 3.0-7 works fine here too!!!
Comment 18 Pekka Savola 2002-08-17 16:58:46 EDT
skipjack-beta2 -> RHL73, dhcpcd -> dhcp.

Reopening and raising severity; there really needs to be a RHBA IMO especially as dhcp2 is no longer in rawhide.
Comment 19 Pekka Savola 2002-08-17 17:00:21 EDT
*** Bug 71662 has been marked as a duplicate of this bug. ***
Comment 20 Elliot Lee 2002-08-26 06:45:49 EDT
Not going to do an erratum due to general priorities.

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