Busybox project : DHCP Client multi instance possible ?

Denis Vlasenko vda.linux at googlemail.com
Wed May 2 20:51:48 UTC 2007


Hi Yvon,

Can you convince your mail client to wrap lines?

I am CCing the list because discussing this with community
may be useful.

On Wednesday 02 May 2007 18:07, yvon le goue wrote:
> Hello Denis,
>    
>   In our product, we want to monitor all the dhcp events in the different interfaces. For this, we want to have one thread called links_thread that will manage several dhcp client thread.
>   For example :
>    if one dhcp client doesn't arrive to have its IP address (no response from the DHCP server...), we want to know this information at a upper layer (in the link thread) to decide the behaviour that the product will have (the product is not operationnal or the product is in a restricted mode...)

I think you are trying to reinvent the wheel.

udhcpc executes an external program (shell script typically)
on each state change. This program can be common to all
running udhcpc's on different interfaces.

It can be written so that it maintains coherent view as to
what is the state of every interface, and do something sensible
according to this information.

This functionaly already exists. Use it.

>   So it is not for memory reason but for usefull management reason. For me, it's more easy to communicate information between thread in a same process  (using memory) than between differents process (using socket).
>   Furthermore, the links thread is the parent thread, it will create/destroy the child dhcpc client instance.

Writing this in C (by modifying udhcpc) is going to be slower,
more bug prone, harder to debug, and harder to customize
for the needs of different situations.

Of course, it also will run faster, which is not important
in real life - you don't get hundreds of dhcp state changes
per second.
--
vda



More information about the busybox mailing list