summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a90d0e)
raw | patch | inline | side by side (parent: 5a90d0e)
author | Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com> | |
Tue, 8 Nov 2016 16:19:56 +0000 (16:19 +0000) | ||
committer | Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com> | |
Mon, 26 Dec 2016 13:26:05 +0000 (13:26 +0000) |
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>
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>
src/ovs_events.c | patch | blob | history |
diff --git a/src/ovs_events.c b/src/ovs_events.c
index 1f63a065a554988e9e2f784cfba6723bfe8f3ae2..35f749c6bb28f7246b6953730fa75bba7f850e77 100644 (file)
--- a/src/ovs_events.c
+++ b/src/ovs_events.c
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)
" :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);
+ }
}
}
}
/* 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