[Dnsmasq-discuss] DHCP Address - Lease in numerical order

Paul Fox pgf at foxharp.boston.ma.us
Fri Dec 21 16:30:11 GMT 2007


simon wrote:
 > Paul Fox wrote:
 > > so why isn't it sufficient to keep a record of which client last had
 > > any address in the offered ranges?  this is no bigger than the records
 > > one has to keep if all addresses are in use, right?
 > > 
 > 
 > I followed the spec: from RFC2131
 > 
 >    When a server receives a DHCPDISCOVER message from a client, the
 >    server chooses a network address for the requesting client.  If no
 >    address is available, the server may choose to report the problem to
 >    the system administrator. If an address is available, the new address
 >    SHOULD be chosen as follows:
 > 
 >       o The client's current address as recorded in the client's current
 >         binding, ELSE
 > 
 >       o The client's previous address as recorded in the client's (now
 >         expired or released) binding, if that address is in the server's
 >         pool of available addresses and not already allocated, ELSE
 > 
 >       o The address requested in the 'Requested IP Address' option, if that
 >         address is valid and not already allocated, ELSE
 > 
 >       o A new address allocated from the server's pool of available
 >         addresses; the address is selected based on the subnet from which
 >         the message was received (if 'giaddr' is 0) or on the address of
 >         the relay agent that forwarded the message ('giaddr' when not 0).
 > 
 > The hash mechanism is my low-resource way of implementing the second bullet.


i see.  yes, you're right -- i guess i'd never read that second
bullet quite that literally.  i've always read it as "if that
address is in the server's pool of available addresses and hasn't
been reallocated in the interim", which of course, involves some liberal
interpretation on my part :-), and isn't quite the same thing.

nice work.

paul
=---------------------
 paul fox, pgf at foxharp.boston.ma.us (arlington, ma, where it's 18.0 degrees)



More information about the Dnsmasq-discuss mailing list