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>
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;