Question about ifupdown.c and udhcpc

Max Okumoto max at kiyon.com
Sat Jul 1 07:22:47 UTC 2006


Some ethernet drivers detect at the phy level
 if there is cable attached.  They will not allow
 you to ifconfig up the interface.  So dhcpd will
 fail on the open of the interface.
 
 One way around this problem is to fork
 a program/script to monitor the interface and
 which it succeeds, to invoke dhcpd.
 
                Max

Dave Hylands <dhylands at gmail.com> wrote: Hi,

I've been looking into a problem where udhcpc sometimes hangs around
and sometimes goes away. I think I've narrowed the behaviour down to
this:

1 - If I bring the ethernet adapter up and no cable is plugged in,
then udhcpc quits after a few seconds.

2 - If I bring the ethernet adapter up and the cable is plugged in,
then udhcpc hangs around, even across multiple cable
removal/insertions.

I looked at the networking/ifupdown.c and saw this:

    if (execable("/sbin/udhcpc")) {
        return( execute("udhcpc -n -p /var/run/udhcpc.%iface%.pid -i "

in the dhcp_up routine. The -n option tells udhcpc to quit if it can't
get a lease, which would be the case if the cable isn't plugged in.

So my question is: is this the expected behaviour? Do I have something
else misconfigured?

Should cable insertion/removals have any impact on udhcp?

-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/
_______________________________________________
busybox mailing list
busybox at busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060701/2a8e7329/attachment-0001.htm 


More information about the busybox mailing list