2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-25 19:08:35 +00:00

[cmdline] Accept "netX" in iPXE commands

Allow any iPXE command expecting a network device name to accept
"netX" as a synonym for "most recently opened network device".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2013-07-13 15:22:34 +02:00
parent 66ea458125
commit eba6bb38f2

View File

@ -670,6 +670,11 @@ void netdev_irq ( struct net_device *netdev, int enable ) {
struct net_device * find_netdev ( const char *name ) {
struct net_device *netdev;
/* Allow "netX" shortcut */
if ( strcmp ( name, "netX" ) == 0 )
return last_opened_netdev();
/* Identify network device by name */
list_for_each_entry ( netdev, &net_devices, list ) {
if ( strcmp ( netdev->name, name ) == 0 )
return netdev;