udhcpc: Add support to change default interface name
Signed-off-by: Andre Kalb <Andre.Kalb@sma.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
868f383699
commit
5f2e00f66d
@ -104,6 +104,14 @@ INSERT
|
|||||||
comment "Common options for DHCP applets"
|
comment "Common options for DHCP applets"
|
||||||
depends on UDHCPD || UDHCPC || UDHCPC6 || DHCPRELAY
|
depends on UDHCPD || UDHCPC || UDHCPC6 || DHCPRELAY
|
||||||
|
|
||||||
|
config UDHCPC_DEFAULT_INTERFACE
|
||||||
|
string "Default interface name"
|
||||||
|
default "eth0"
|
||||||
|
depends on UDHCPC || UDHCPC6
|
||||||
|
help
|
||||||
|
The interface that will be used if no other interface is
|
||||||
|
specified on the commandline.
|
||||||
|
|
||||||
config FEATURE_UDHCP_PORT
|
config FEATURE_UDHCP_PORT
|
||||||
bool "Enable '-P port' option for udhcpd and udhcpc"
|
bool "Enable '-P port' option for udhcpd and udhcpc"
|
||||||
default n
|
default n
|
||||||
|
@ -1163,7 +1163,7 @@ static void client_background(void)
|
|||||||
//usage: "[-fbnq"IF_UDHCP_VERBOSE("v")"odR] [-i IFACE] [-r IPv6] [-s PROG] [-p PIDFILE]\n"
|
//usage: "[-fbnq"IF_UDHCP_VERBOSE("v")"odR] [-i IFACE] [-r IPv6] [-s PROG] [-p PIDFILE]\n"
|
||||||
//usage: " [-x OPT:VAL]... [-O OPT]..." IF_FEATURE_UDHCP_PORT(" [-P PORT]")
|
//usage: " [-x OPT:VAL]... [-O OPT]..." IF_FEATURE_UDHCP_PORT(" [-P PORT]")
|
||||||
//usage:#define udhcpc6_full_usage "\n"
|
//usage:#define udhcpc6_full_usage "\n"
|
||||||
//usage: "\n -i IFACE Interface to use (default eth0)"
|
//usage: "\n -i IFACE Interface to use (default "CONFIG_UDHCPC_DEFAULT_INTERFACE")"
|
||||||
//usage: "\n -p FILE Create pidfile"
|
//usage: "\n -p FILE Create pidfile"
|
||||||
//usage: "\n -s PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")"
|
//usage: "\n -s PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")"
|
||||||
//usage: "\n -B Request broadcast replies"
|
//usage: "\n -B Request broadcast replies"
|
||||||
@ -1231,7 +1231,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
/* Default options */
|
/* Default options */
|
||||||
IF_FEATURE_UDHCP_PORT(SERVER_PORT6 = 547;)
|
IF_FEATURE_UDHCP_PORT(SERVER_PORT6 = 547;)
|
||||||
IF_FEATURE_UDHCP_PORT(CLIENT_PORT6 = 546;)
|
IF_FEATURE_UDHCP_PORT(CLIENT_PORT6 = 546;)
|
||||||
client_data.interface = "eth0";
|
client_data.interface = CONFIG_UDHCPC_DEFAULT_INTERFACE;
|
||||||
client_data.script = CONFIG_UDHCPC_DEFAULT_SCRIPT;
|
client_data.script = CONFIG_UDHCPC_DEFAULT_SCRIPT;
|
||||||
client_data.sockfd = -1;
|
client_data.sockfd = -1;
|
||||||
|
|
||||||
|
@ -1196,7 +1196,7 @@ static void client_background(void)
|
|||||||
//usage: " [-i IFACE]"IF_FEATURE_UDHCP_PORT(" [-P PORT]")" [-s PROG] [-p PIDFILE]\n"
|
//usage: " [-i IFACE]"IF_FEATURE_UDHCP_PORT(" [-P PORT]")" [-s PROG] [-p PIDFILE]\n"
|
||||||
//usage: " [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x OPT:VAL]... [-O OPT]..."
|
//usage: " [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x OPT:VAL]... [-O OPT]..."
|
||||||
//usage:#define udhcpc_full_usage "\n"
|
//usage:#define udhcpc_full_usage "\n"
|
||||||
//usage: "\n -i IFACE Interface to use (default eth0)"
|
//usage: "\n -i IFACE Interface to use (default "CONFIG_UDHCPC_DEFAULT_INTERFACE")"
|
||||||
//usage: IF_FEATURE_UDHCP_PORT(
|
//usage: IF_FEATURE_UDHCP_PORT(
|
||||||
//usage: "\n -P PORT Use PORT (default 68)"
|
//usage: "\n -P PORT Use PORT (default 68)"
|
||||||
//usage: )
|
//usage: )
|
||||||
@ -1265,7 +1265,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
/* Default options */
|
/* Default options */
|
||||||
IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;)
|
IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;)
|
||||||
IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;)
|
IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;)
|
||||||
client_data.interface = "eth0";
|
client_data.interface = CONFIG_UDHCPC_DEFAULT_INTERFACE;
|
||||||
client_data.script = CONFIG_UDHCPC_DEFAULT_SCRIPT;
|
client_data.script = CONFIG_UDHCPC_DEFAULT_SCRIPT;
|
||||||
client_data.sockfd = -1;
|
client_data.sockfd = -1;
|
||||||
str_V = "udhcp "BB_VER;
|
str_V = "udhcp "BB_VER;
|
||||||
|
Loading…
Reference in New Issue
Block a user