- }
- Check that statistics is an array with 2 elements
- */
- if (iface_stats && YAJL_IS_ARRAY(iface_stats) &&
- YAJL_GET_ARRAY(iface_stats)->len == 2)
- ovs_stats_update_iface_stats(port,
- YAJL_GET_ARRAY(iface_stats)->values[1]);
- if (iface_ext_ids && YAJL_IS_ARRAY(iface_ext_ids))
- ovs_stats_update_iface_ext_ids(
- port, YAJL_GET_ARRAY(iface_ext_ids)->values[1]);
- if (iface_uuid && YAJL_IS_ARRAY(iface_uuid) &&
- YAJL_GET_ARRAY(iface_uuid)->len == 2)
- sstrncpy(port->iface_uuid,
- YAJL_GET_STRING(YAJL_GET_ARRAY(iface_uuid)->values[1]),
- sizeof(port->iface_uuid));
- }
- } else {
- ERROR("Incorrect JSON Port data");
+ ]
+ ]
+ }
+ Check that statistics is an array with 2 elements
+ */
+ if (iface_stats && YAJL_IS_ARRAY(iface_stats) &&
+ YAJL_GET_ARRAY(iface_stats)->len == 2)
+ ovs_stats_update_iface_stats(port, YAJL_GET_ARRAY(iface_stats)->values[1]);
+ if (iface_ext_ids && YAJL_IS_ARRAY(iface_ext_ids))
+ ovs_stats_update_iface_ext_ids(port,
+ YAJL_GET_ARRAY(iface_ext_ids)->values[1]);
+ if (iface_uuid && YAJL_IS_ARRAY(iface_uuid) &&
+ YAJL_GET_ARRAY(iface_uuid)->len == 2 &&
+ YAJL_GET_STRING(YAJL_GET_ARRAY(iface_uuid)->values[1]) != NULL)
+ sstrncpy(port->iface_uuid,
+ YAJL_GET_STRING(YAJL_GET_ARRAY(iface_uuid)->values[1]),
+ sizeof(port->iface_uuid));
+ else {
+ ERROR("ovs_stats plugin: incorrect JSON interface data");