mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-29 04:39:42 +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:
parent
66ea458125
commit
eba6bb38f2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user