udhcpd initial lease

Ralf Friedl Ralf.Friedl at online.de
Sun Nov 28 09:14:34 UTC 2010


Denys Vlasenko wrote:
> On Friday 26 November 2010 23:04, Dan Fandrich wrote:
>   
>> Yes, exactly. If the server is going to provide an address anyway
>> (eventually) and the suggested one is valid, why not give the client what
>> it wants?
>>     
>
> That's what we do:
>
> When we receive DISCOVER packet, we retrieve "requested IP",
> put it into the lease table for 60 seconds,
> put it into packet.yiaddr and send the reply.
>
> When we later get REQUEST packet, we find "requested IP"
> in lease table and therefore ACK this REQUEST.
>
> This is how it supposed to work.
>
> We need to understand why it doesn't work.
>
> tcpdump output would be very useful to see.
Actually I've never seen DISCOVER packets with a requested IP.
The Client will not send DISCOVER, it will immediately send a REQUEST 
for the last IP. Only after a NAK to this REQUEST it will send a a 
DISCOVER, and then a new REQUEST for the IP from the OFFER.

So it would be reasonable to grant a REQUEST if the IP is in the correct 
range and free, even if it was not previously OFFERed.

Ralf


More information about the busybox mailing list