summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-04-30 12:49:43 +0200
committerThomas Haller <thaller@redhat.com>2016-05-03 11:52:40 +0200
commita51b947f252953e2c5ea75dea60fc38de101872b (patch)
tree1edf4a4e006595171f1cac5d3259613876559fd3
parentb52d25e129e30e15ee8d63792d3549fb3ec1ab04 (diff)
downloadNetworkManager-a51b947f252953e2c5ea75dea60fc38de101872b.tar.gz
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.
-rw-r--r--src/devices/nm-device.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 48c52005e4..6894cbb49c 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -7329,14 +7329,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,