[ovs-dev] [PATCH] odp-util: Initialize tun_key and tun_key_mask

Thomas Graf tgraf at noironetworks.com
Tue Aug 26 00:49:55 UTC 2014


tun_key_to_attr() accesses tp_src and tp_dst which are currently
uinitialized.

Signed-off-by: Thomas Graf <tgraf at noironetworks.com>
---
 lib/odp-util.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index ffc3673..19d0627 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -1784,6 +1784,9 @@ parse_odp_key_mask_attr(const char *s, const struct simap *port_names,
         struct flow_tnl tun_key, tun_key_mask;
         int n = -1;
 
+        memset(&tun_key, 0, sizeof tun_key);
+        memset(&tun_key_mask, 0, sizeof tun_key_mask);
+
         if (mask && ovs_scan(s, "tunnel(tun_id=%"SCNi64"/%"SCNi64","
                              "src="IP_SCAN_FMT"/"IP_SCAN_FMT",dst="IP_SCAN_FMT
                              "/"IP_SCAN_FMT",tos=%"SCNi8"/%"SCNi8","
-- 
1.9.3




More information about the dev mailing list