mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 21:10:25 +01:00
initrd: sort ibft connections
Instead of adding ibft connections in a random order to the list, sort them alphabetically.
This commit is contained in:
parent
9b5322b33c
commit
f3c9ee921e
1 changed files with 6 additions and 3 deletions
|
|
@ -249,19 +249,22 @@ read_all_connections_from_fw (Reader *reader, const char *sysfs_dir)
|
|||
{
|
||||
gs_unref_hashtable GHashTable *ibft = NULL;
|
||||
NMConnection *dt_connection;
|
||||
GHashTableIter iter;
|
||||
const char *mac;
|
||||
GHashTable *nic;
|
||||
const char *index;
|
||||
GError *error = NULL;
|
||||
guint i, length;
|
||||
gs_free const char **keys = NULL;
|
||||
|
||||
ibft = nmi_ibft_read (sysfs_dir);
|
||||
keys = nm_utils_strdict_get_keys (ibft, TRUE, &length);
|
||||
|
||||
g_hash_table_iter_init (&iter, ibft);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &mac, (gpointer *) &nic)) {
|
||||
for (i = 0; i < length; i++) {
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
gs_free char *name = NULL;
|
||||
|
||||
mac = keys[i];
|
||||
nic = g_hash_table_lookup (ibft, mac);
|
||||
connection = nm_simple_connection_new ();
|
||||
index = g_hash_table_lookup (nic, "index");
|
||||
if (!index) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue