Subject: Re: dhclient still taking up 95% of CPU
To: Peter Seebach <>
From: Laine Stump <>
List: current-users
Date: 10/22/2000 13:44:24 (Peter Seebach) writes:

> In message <20001022095345.A6106@vex>, David Maxwell writes:
> >Have you tried a ktrace?
> Followup:  The problem is that the server is giving us about a 500,000,000
> second lease, and NetBSD refuses to let select() sleep for more than
> 100,000,000 seconds.  I don't know if that number (in itimerfix, in
> kern_time.c) is meaningful or arbitrary.  In any event, I've notified
> dhcp-bugs that they should check the return of select,

They already are checking the return of select. The only problem is
that they're assuming that an error return means that one of the fd's
is bad. Even if they checked errno, it wouldn't be 100% certain that
the problem was due to the timeval.

Unless there is a standards document somewhere that says timevals are
valid only up to 100,000,000 seconds, I think the behavior of select()
should change to allow setting any timeout that is representable by
the datatypes used for struct timeval (the select() manpage certainly
doesn't document any such limitation, nor does the description of
select() in Comer's Volume III (it points to gettimeofday for a fuller
description of timeval, and NetBSD gettimeofday, at least, says
nothing of a 100,000,000 limit.)

However, even if select is fixed, timeval is still only valid up to 2
billion something (since it's a signed long), while a dhcp lease time
can be up to 4 billion (unsigned long). So dhcp still needs to at
least make sure that it isn't setting tv_sec to a negative value (as a
matter of fact, my system would still be broken with a fixed select(),
because the lease time from RCN is 0xFFFFFF3F seconds)

> and I'm notifying
> Connectix that they should give plausible lease times.

Not that I don't agree that would be *nice* to gie shorter lease
times, but it's perfectly *legal* for them to give out lease times as
long as they want (within the limits of representation), as long as
they *guarantee* the address won't be given to anybody else. RCN gives
out long lease times because in reality each modem has a more-or-less
static IP address; they only use DHCP so that customers won't need to
manually configure their computers. (Of course they did cause problems
about a year ago when they decided to renumber their entire network
without telling anybody - they reprogrammed all the cable modems and
everyone's link magically stopped working until they rebooted their
machine. Just one in a long list of displays of incompetence...)