udhcp and busybox

Devin Bayer devin at freeshell.org
Tue Mar 28 22:38:55 UTC 2006


Rob Landley wrote:
> On Monday 27 March 2006 5:04 pm, Devin Bayer wrote:
> 
>>>Even the common case of a router wouldn't need this, because you only run
>>>the dhcp _client_ on one interface.
>>
>>In the common case of a router, you do need this. If you have a running
>>system with a gateway and then run udhcpc, it'll create two gateways and
>>knock your system off all the networks.
>>
>>Well, that's all I have to say; I won't argue anymore.
> 
> It must remove the existing default gateway (if any) when adding a new default 
> gateway, yes.  Since you can only have one default gateway (this would be 
> what "default" means), the route command should do this for a "route add 
> default gw" invocation.

OK, that's good. It works.  FYI, it differs from the net-tools route behavior. 
Just to be clear, you are saying the new udhcpc will use the route command?

Here is my patch to route.  Before adding a gateway, it deletes all other gateways
with the same target network. Tested in linux 2.6.11.

   text    data     bss     dec     hex filename
   2255       0       0    2255     8cf networking/route-orig.o
   2255       0       0    2255     8cf networking/route-new.o
   2466       0       0    2466     9a2 networking/route-nodupes.o

-- 
Devin Bayer
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bb-route-nodupes.patch
Url: http://lists.busybox.net/pipermail/busybox/attachments/20060328/f826f2aa/attachment.diff 


More information about the busybox mailing list