- char *key = YAJL_GET_STRING(YAJL_GET_ARRAY(ext_id)->values[0]);
- char *value = YAJL_GET_STRING(YAJL_GET_ARRAY(ext_id)->values[1]);
- if (key && value) {
- if (strncmp(key, "iface-id", strlen(key)) == 0) {
- sstrncpy(iface->ex_iface_id, value, sizeof(iface->ex_iface_id));
- } else if (strncmp(key, "vm-uuid", strlen(key)) == 0) {
- sstrncpy(iface->ex_vm_id, value, sizeof(iface->ex_vm_id));
- }
+ for (size_t i = 0; i < YAJL_GET_ARRAY(ext_ids)->len; i++) {
+ yajl_val ext_id = YAJL_GET_ARRAY(ext_ids)->values[i];
+ if (!YAJL_IS_ARRAY(ext_id))
+ return -1;
+
+ char *key = YAJL_GET_STRING(YAJL_GET_ARRAY(ext_id)->values[0]);
+ char *value = YAJL_GET_STRING(YAJL_GET_ARRAY(ext_id)->values[1]);
+ if (key && value) {
+ if (strncmp(key, "iface-id", strlen(key)) == 0) {
+ sstrncpy(iface->ex_iface_id, value, sizeof(iface->ex_iface_id));
+ } else if (strncmp(key, "vm-uuid", strlen(key)) == 0) {
+ sstrncpy(iface->ex_vm_id, value, sizeof(iface->ex_vm_id));