diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h index 0b8444112a..c76debffb3 100644 --- a/src/devices/nm-device-private.h +++ b/src/devices/nm-device-private.h @@ -134,7 +134,7 @@ void nm_device_commit_mtu (NMDevice *self); } gboolean _nm_device_hash_check_invalid_keys (GHashTable *hash, const char *setting_name, - GError **error, const char **argv); + GError **error, const char **whitelist); #define nm_device_hash_check_invalid_keys(hash, setting_name, error, ...) \ _nm_device_hash_check_invalid_keys (hash, setting_name, error, ((const char *[]) { __VA_ARGS__, NULL })) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1ffcb44e50..6cda25bb3e 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -10194,33 +10194,33 @@ _cleanup_ip_pre (NMDevice *self, int addr_family, CleanupType cleanup_type) gboolean _nm_device_hash_check_invalid_keys (GHashTable *hash, const char *setting_name, - GError **error, const char **argv) + GError **error, const char **whitelist) { - guint found_keys = 0; + guint found_whitelisted_keys = 0; guint i; nm_assert (hash && g_hash_table_size (hash) > 0); - nm_assert (argv && argv[0]); + nm_assert (whitelist && whitelist[0]); #if NM_MORE_ASSERTS > 10 /* Assert that the keys are unique. */ { gs_unref_hashtable GHashTable *check_dups = g_hash_table_new_full (nm_str_hash, g_str_equal, NULL, NULL); - for (i = 0; argv[i]; i++) { - if (!g_hash_table_add (check_dups, (char *) argv[i])) + for (i = 0; whitelist[i]; i++) { + if (!g_hash_table_add (check_dups, (char *) whitelist[i])) nm_assert (FALSE); } nm_assert (g_hash_table_size (check_dups) > 0); } #endif - for (i = 0; argv[i]; i++) { - if (g_hash_table_contains (hash, argv[i])) - found_keys++; + for (i = 0; whitelist[i]; i++) { + if (g_hash_table_contains (hash, whitelist[i])) + found_whitelisted_keys++; } - if (found_keys != g_hash_table_size (hash)) { + if (found_whitelisted_keys != g_hash_table_size (hash)) { GHashTableIter iter; const char *k = NULL; const char *first_invalid_key = NULL; @@ -10230,7 +10230,7 @@ _nm_device_hash_check_invalid_keys (GHashTable *hash, const char *setting_name, g_hash_table_iter_init (&iter, hash); while (g_hash_table_iter_next (&iter, (gpointer *) &k, NULL)) { - if (nm_utils_strv_find_first ((char **) argv, -1, k) < 0) { + if (nm_utils_strv_find_first ((char **) whitelist, -1, k) < 0) { first_invalid_key = k; break; }