[PATCH] overriding udhcpc

Natanael Copa natanael.copa at gmail.com
Fri Mar 23 14:06:18 UTC 2007


Hi,

I run a busybox/uclibc based distro. I would like to ship with the
busybox provided udhcpc by default, but at the same time to give the
user opportunity to use another if he/she finds udhcpc not good enough.

Earlier it was possible but its not any more:

static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_APP_UDHCPC
        return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
                        "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
                        ifd, exec);
#else
        int i, nclients = sizeof(ext_dhcp_clients) / sizeof(ext_dhcp_clients[0]);
        for (i = 0; i < nclients; i++) {
                if (exists_execable(ext_dhcp_clients[i].name))
                        return execute(ext_dhcp_clients[i].startcmd, ifd, exec);
        }
        bb_error_msg("no dhcp clients found");
        return 0;
#endif
}

So, if you have enabled APP_UDHCPC, you will never be able to override
it.

Would it be an idea to have a config option for "external dhcp client
support", "additional dhcp clients" or something similar?

Patch attatched. User will get the option to either disable dhcp
totally, use internal udhcpc only or look for external. If no external
is found and APP_UDHCPC is enabled, it will be used as fallback.

Natanael Copa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifupdown-external-dhcp.patch
Type: text/x-patch
Size: 3663 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070323/04c4585b/attachment-0002.bin 


More information about the busybox mailing list