pre-creating reserved leases

David W. Hankins David_Hankins at
Fri Feb 27 17:56:06 UTC 2009

On Fri, Feb 27, 2009 at 11:51:03AM -0600, Foggi, Nicola wrote:
> Started looking through the source code, i can't seem to find anyplace where it looks in the reserved pool during a DHCPDISCOVER, at this point are the reserved leases stored in a separate pool?  (Still digging deeper into the code, but getting way past what I can dive into, so have to bring in some backup to dig deeper).

Prior to allocating a "fresh" address, the server tries to find the
'best' existing lease for the client using the client id or hardware
address fields.  I think the sorting algorithm prefers reserved
leases, followed by active leases, followed by the most recently
active lease.  I think the function is literally called 'find_lease'.

Reserved leases are only found in that manner - they are never found
as "brand new allocations to clients for the first time," so the
queue of reserved leases linked list never needs to be inspected
like the free and backup queues are.

David W. Hankins	"If you don't do it right the first time,
Software Engineer		     you'll just have to do it again."
Internet Systems Consortium, Inc.		-- Jack T. Hankins
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <>

More information about the dhcp-users mailing list