[PATCH] add IP check functionality to udhcpc
Cristian Ionescu-Idbohrn
cristian.ionescu-idbohrn at axis.com
Thu Nov 22 23:24:59 UTC 2007
On Thu, 22 Nov 2007, Denys Vlasenko wrote:
> > About the -W seconds. I added it because of what was pointed out in the
> > RFC2131:
> >
> > 5. The client receives the DHCPACK message with configuration
> > parameters. The client SHOULD perform a final check on the
> > parameters (e.g., ARP for allocated network address), and notes the
> > duration of the lease specified in the DHCPACK message. At this
> > point, the client is configured. If the client detects that the
> > address is already in use (e.g., through the use of ARP), the
> > client MUST send a DHCPDECLINE message to the server and restarts
> > the configuration process. The client SHOULD wait a minimum of ten
> > seconds before restarting the configuration process to avoid
> > excessive network traffic in case of looping.
> >
> >
> > It is the matter of the minimum of 10 seconds that made me include it.
> > But maybe it is better to reuse the --tryagain flag
> > and set a lower bound on it?
>
> I modified the source to reuse that. We already have too many options,
> need to conserve them ;)
Sorry to insist Denys. I do understand what you mean, but please
reconsider adding back the -W option. The rfc states:
In the case of a duplicated ip-address:
"The client SHOULD wait a minimum of ten seconds before restarting the
configuration process", and I think we need to prvide that number. I see
that is possible to do it with:
-A,--tryagain=N Wait N seconds (default 20) after failure
but -A has another purpose (see the same rfc, a little lower down):
"as described in section 4.1 might retransmit the DHCPREQUEST message four
times, for a total delay of 60 seconds, before restarting the
initialization procedure"
Unless I'm missing something obvious, I have dificulties figuring out how
(on the same command line) to follow both rfc recommendations (the 60s
and the 10s). If the dhcp-server doesn't answer, we try 4 times and wait
60s before we do another attempt _and_ if it answers but gives us a
dupplicated ip-address, decline it and wait 10s before we repeat the
cycle.
Cheers,
--
Cristian
More information about the busybox
mailing list