device: fix check for invalid keys during reapply

Was completely wrong and failed to find first_invalid_key.
As a consequence, hit the assertion at the end.

(cherry picked from commit a51b947f25)
This commit is contained in:
Thomas Haller 2016-04-30 12:49:43 +02:00
parent ba3f9879dc
commit 16d0cc332a

View file

@ -7178,14 +7178,10 @@ _hash_check_invalid_keys_impl (GHashTable *hash, const char *setting_name, GErro
g_hash_table_iter_init (&iter, hash);
while (g_hash_table_iter_next (&iter, (gpointer *) &k, NULL)) {
for (i = 0; argv[i]; i++) {
if (!strcmp (argv[i], k)) {
first_invalid_key = k;
break;
}
}
if (first_invalid_key)
if (_nm_utils_strv_find_first ((char **) argv, -1, k) < 0) {
first_invalid_key = k;
break;
}
}
g_set_error (error,
NM_DEVICE_ERROR,