Hi Rob. I have a question about belowing patch. there is a case that dhcpd just wants to have other interface name. Is adding i option for dhcpd reasonable?
Common dhcpd gets an interface name from argument, while toybox gets a config file from argument. plz have a look. diff --git a/toys/pending/dhcpd.c b/toys/pending/dhcpd.c index 9c3389c..46951cd 100644 --- a/toys/pending/dhcpd.c +++ b/toys/pending/dhcpd.c @@ -4,15 +4,16 @@ * Copyright 2013 Kyungwan Han <[email protected]> * * No Standard -USE_DHCPD(NEWTOY(dhcpd, ">1P#<0>65535=67fS", TOYFLAG_SBIN|TOYFLAG_ROOTONLY)) +USE_DHCPD(NEWTOY(dhcpd, ">1P#<0>65535=67fi:S", TOYFLAG_SBIN|TOYFLAG_ROOTONLY)) config DHCPD bool "dhcpd" default n help - usage: dhcpd [-fS] [-P N] [CONFFILE] + usage: dhcpd [-fS] [-i IFACE] [-P N] [CONFFILE] -f Run in foreground + -i Interface to use (default eth0) -S Log to syslog too -P N Use port N (default 67) @@ -79,6 +80,7 @@ config DEBUG_DHCP #define DHCP_OPT_END 0xff GLOBALS( + char *iface; long port; ); @@ -1104,7 +1106,8 @@ void dhcpd_main(void) write_pid(gconfig.pidfile); set_maxlease(); read_leasefile(); - + if(flag_chk(FLAG_i)) + gconfig.interface = flag_get(FLAG_i, TT.iface, "eth0"); if (get_interface(gconfig.interface, &gconfig.ifindex, &gconfig.server_nip, gconfig.server_mac)<0) perror_exit("Failed to get interface %s", gconfig.interface);
_______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
