]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[netdevice] Ensure consistent interpretation of "netX" device name
authorMichael Brown <mcb30@ipxe.org>
Tue, 17 Jan 2023 12:42:46 +0000 (12:42 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 17 Jan 2023 12:42:46 +0000 (12:42 +0000)
Ensure that the "${netX/...}" settings mechanism always uses the same
interpretation of the network device corresponding to "netX" as any
other mechanism that performs a name-based lookup of a network device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/netdev_settings.c

index cc2e1035416b7e99244139eb23493342625b4f1c..fb98663ca0edc1d4b4e8eddd43c6190e52537cea 100644 (file)
@@ -370,8 +370,8 @@ struct settings_operations netdev_settings_operations = {
 static struct settings * netdev_redirect ( struct settings *settings ) {
        struct net_device *netdev;
 
-       /* Redirect to most recently opened network device */
-       netdev = last_opened_netdev();
+       /* Redirect to "netX" network device */
+       netdev = find_netdev ( settings->name );
        if ( netdev ) {
                return netdev_settings ( netdev );
        } else {