X-Git-Url: http://git.etherboot.org/people/mcb30/gpxe.git/blobdiff_plain/3c06277bbb6ea135e6a1daf22463a347fc7898c7..ef9d1a32c6dc83d1086141c18d2be19a05ab8e49:/src/core/settings.c?ds=sidebyside diff --git a/src/core/settings.c b/src/core/settings.c index 7a02985b..fe67d6b7 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -328,11 +328,20 @@ parse_settings_name ( const char *name, /* Parse each name component in turn */ while ( remainder ) { + struct net_device *netdev; + subname = remainder; remainder = strchr ( subname, '.' ); if ( remainder ) *(remainder++) = '\0'; - settings = get_child ( settings, subname ); + + /* Special case "netX" root settings block */ + if ( ( subname == name_copy ) && ! strcmp ( subname, "netX" ) && + ( ( netdev = last_opened_netdev() ) != NULL ) ) + settings = get_child ( settings, netdev->name ); + else + settings = get_child ( settings, subname ); + if ( ! settings ) break; } @@ -782,8 +791,12 @@ int setting_cmp ( struct setting *a, struct setting *b ) { if ( a->tag && ( a->tag == b->tag ) ) return 0; - /* Otherwise, compare the names */ - return strcmp ( a->name, b->name ); + /* Otherwise, if the settings have names, compare them */ + if ( a->name && b->name && a->name[0] ) + return strcmp ( a->name, b->name ); + + /* Otherwise, return a non-match */ + return ( ! 0 ); } /******************************************************************************