lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] Re: DHCP option "Requested IP"


From: Jakob Stoklund Olesen
Subject: [lwip-devel] Re: DHCP option "Requested IP"
Date: Mon, 21 Sep 2009 20:27:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux)

Fabian Koch <address@hidden> writes:

> No I explicitly want to use the DHCP Option Code 50, which suggests an IP to 
> the DHCP server while doing
> DISCOVER and REQUEST.

I see. Since REQUEST packets already contain option 50, I assume you
only want to change DISCOVER packets.

Note that REQUEST packets contain dhcp->offered_ip_addr while you propose
to send netif->ip_addr in DISCOVER packets.

> This is explained in RFC 2132. I'm just looking for a smooth way to integrate 
> this into LwIP without changing
> too much code and especially any APIs.
> So I figured it would be nice to get your netif set up and give it the 
> desired IP and send it to dhcp_start(),
> which calls dhcp_discover() and then the set IP is used for the DISCOVER and 
> REQUEST packets inside the options
> field.

RFC 2131 explicitly allows option 50 in DISCOVER packets, so I don't see
anything wrong with your idea. As Kieran suggested, you may want to
consider a way of enabling this per netif.

> So if the Server agrees with your desired IP and it's free, he will OFFER it 
> and ACK it.

You also talked about sending DHCP_INFORM, so I should warn you that it
is not the same thing.

INFORM tells the server that you are using a manually configured
address.

DISCOVER with option 50 is a polite hint to the server to please offer
the suggested address. The server is free to offer any address it pleases.

>
> Doesn't have to do anything with a reboot or lease.
>
> My question was: is the LwIP crew okay with that approach?

I think it sounds OK. You should definitely submit a patch.

You may not want to clear the netif->ip_addr in dhcp_discover(). It is
called multiple times on retransmissions.

/jakob





reply via email to

[Prev in Thread] Current Thread [Next in Thread]