summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5a90d0e)
If some of interface data is not available, the garbage
information may be returned by ovs_events_get_iface_info() function.
Add clean-up interface information structure into the function.
Change-Id: Ia3d2bdfe31d0b3db81ad7ad773eca1df5d5f6f6a
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
if (!YAJL_IS_OBJECT(jobject))
return (-1);
if (!YAJL_IS_OBJECT(jobject))
return (-1);
+ /* zero the interface info structure */
+ memset(ifinfo, 0, sizeof(*ifinfo));
+
/* try to find external_ids, name and link_state fields */
jexternal_ids = ovs_utils_get_value_by_key(jobject, "external_ids");
if (jexternal_ids == NULL || ifinfo == NULL)
/* try to find external_ids, name and link_state fields */
jexternal_ids = ovs_utils_get_value_by_key(jobject, "external_ids");
if (jexternal_ids == NULL || ifinfo == NULL)
" :unexpected interface information data received");
return;
}
" :unexpected interface information data received");
return;
}
- if (ovs_events_config_iface_exists(ifinfo.name) != 0)
+ if (ovs_events_config_iface_exists(ifinfo.name) != 0) {
+ DEBUG("name=%s, uuid=%s, ext_iface_id=%s, ext_vm_uuid=%s", ifinfo.name,
+ ifinfo.uuid, ifinfo.ext_iface_id, ifinfo.ext_vm_uuid);
/* dispatch notification */
ovs_events_dispatch_notification(&ifinfo);
/* dispatch notification */
ovs_events_dispatch_notification(&ifinfo);
}
/* get interfaces info */
for (int j = 0; j < YAJL_GET_ARRAY(jvalue)->len; j++) {
}
/* get interfaces info */
for (int j = 0; j < YAJL_GET_ARRAY(jvalue)->len; j++) {
- memset(&ifinfo, 0, sizeof(ifinfo));
if (ovs_events_get_iface_info(YAJL_GET_ARRAY(jvalue)->values[j],
&ifinfo) < 0) {
ERROR(OVS_EVENTS_PLUGIN
if (ovs_events_get_iface_info(YAJL_GET_ARRAY(jvalue)->values[j],
&ifinfo) < 0) {
ERROR(OVS_EVENTS_PLUGIN