[PATCH] udhcp: infinite retries

Samuel Ortiz sortiz at olivetti-engineering.com
Tue Feb 6 01:36:12 PST 2007


Hi Denis,

Denis Vlasenko wrote:
> On Monday 05 February 2007 17:33, Samuel Ortiz wrote:
>> Hi All,
>>
>> It may be useful (at least it is for us) to keep on sending DHCP request 
>> and renewals for ever until we actually get an answer. For that purpose 
>> udhcpc -t 0 could do the job.
> 
> I guess udhcpc -t 999999999 will be the same in practice.

Almost, but not exactly.
We have machines that can be powered up without being connected to any 
network for weeks. However, we need them to fetch an IP if they ever get 
plugged to some network.


>> Attached you will find the corresponding patch, please let me know if 
>> you'd consider it for inclusion.
> 
> Well, and if for some obscure reason someone wants zero retries?

0 retries would be one try, and that would be -t 1.
With the current code, running udhcpc with -t 0 is quite useless since 
it will not send _any_ DHCP frame since packet_num will never be lower
than client_config.retries. I don't see the point of doing that unless 
you're expecting a DHCP offer or ACK without having sent a discovery or 
request previously.
That's why I assumed -t 0 was semantically available, and proposed to 
use it for infinite retries.

Cheers,
Samuel.


More information about the busybox mailing list