aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorHyejin Kim <hj8296@gmail.com>2015-07-03 13:22:37 -0500
committerRob Landley <rob@landley.net>2015-07-03 13:22:37 -0500
commit82d8d7cb7eacabd1a498c001dd5618a1302f854b (patch)
tree94925dedef621e1f0d7161b2a661ace8586e545c /toys
parenteed60d28a76f20a6dd9c6eff8351a44ce020aa12 (diff)
downloadtoybox-82d8d7cb7eacabd1a498c001dd5618a1302f854b.tar.gz
Added i option to use other interface on running dhcpd.
Diffstat (limited to 'toys')
-rw-r--r--toys/pending/dhcpd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/toys/pending/dhcpd.c b/toys/pending/dhcpd.c
index 9c3389cd..1426c69e 100644
--- a/toys/pending/dhcpd.c
+++ b/toys/pending/dhcpd.c
@@ -4,15 +4,16 @@
* Copyright 2013 Kyungwan Han <asura321@gamil.com>
*
* 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
-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,7 @@ void dhcpd_main(void)
write_pid(gconfig.pidfile);
set_maxlease();
read_leasefile();
-
+ if(TT.iface) gconfig.interface = TT.iface;
if (get_interface(gconfig.interface, &gconfig.ifindex, &gconfig.server_nip,
gconfig.server_mac)<0)
perror_exit("Failed to get interface %s", gconfig.interface);