mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 20:40:25 +03:00
[cmdline] Add "--timeout" parameter to "ifconf" command
Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
145311c62e
commit
a08ee6e722
@@ -193,6 +193,8 @@ static int ifstat_exec ( int argc, char **argv ) {
|
||||
|
||||
/** "ifconf" options */
|
||||
struct ifconf_options {
|
||||
/** Configuration timeout */
|
||||
unsigned long timeout;
|
||||
/** Configurator */
|
||||
struct net_device_configurator *configurator;
|
||||
};
|
||||
@@ -202,6 +204,9 @@ static struct option_descriptor ifconf_opts[] = {
|
||||
OPTION_DESC ( "configurator", 'c', required_argument,
|
||||
struct ifconf_options, configurator,
|
||||
parse_netdev_configurator ),
|
||||
OPTION_DESC ( "timeout", 't', required_argument,
|
||||
struct ifconf_options, timeout,
|
||||
parse_timeout ),
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -216,7 +221,8 @@ static int ifconf_payload ( struct net_device *netdev,
|
||||
int rc;
|
||||
|
||||
/* Attempt configuration */
|
||||
if ( ( rc = ifconf ( netdev, opts->configurator ) ) != 0 ) {
|
||||
if ( ( rc = ifconf ( netdev, opts->configurator,
|
||||
opts->timeout ) ) != 0 ) {
|
||||
|
||||
/* Close device on failure, to avoid memory exhaustion */
|
||||
netdev_close ( netdev );
|
||||
|
||||
Reference in New Issue
Block a user