[PATCH] udhcpc: give up on repeated errors

Denys Vlasenko vda.linux at googlemail.com
Wed May 21 02:00:40 UTC 2008


On Wednesday 21 May 2008 01:57, Paul Fox wrote:
>  >  >> udhcpc never time out if errors occur (E.G. if the network
>  >  >> interface didn't detect a link), as the file descriptor keeps
>  >  >> on being readable with the error condition (E.G. -ENETDOWN).
>  >  >> 
>  >  >> Add a max_errors and give up if it is exceeded.
>  > 
>  >  Denys> I as an admin often configure dhcp to run forever (until stopped
>  >  Denys> by external means (SIGTERM)).
>  > 
>  >  Denys> Do I understand you correctly that the problem here is not that udhcpc
>  >  Denys> loops here, but that it loops very fast (i.e. there is no delay)?
>  > 
>  > Well, that's a potential issue as well - but I basically just don't
>  > want it to hang the boot sequence. I would prefer if it behaved like
>  > it does when it doesn't get any replies to the discover (quit or going
>  > into background depending on config).
> 
> why does it hang the boot sequence?  is it not in the background by then?

There is indeeda bug - timeout is not properly decreased in this case.
There are two pending patches which fix this.

Peter, can you apply and test these two patches? They should make
udhcpc honour "abort if no lease" option.

NB: they do not add sleep(N) as I suggested, so udhcpc will still
busy-wait, eating CPU. But at least it will not loop forever.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9.patch
Type: text/x-diff
Size: 2933 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080521/425a763d/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.patch
Type: text/x-diff
Size: 5452 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080521/425a763d/attachment-0001.bin 


More information about the busybox mailing list