From 267e915f526b4102364d92aff4eb9355b8da25ca Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 25 Jan 2013 15:18:48 -0800 Subject: [PATCH] vconn: Initialize 'recv_any_version' member of struct vconn in vconn_init(). This uninitialized data caused failures in the test "ofproto - eviction upon table overflow (OpenFlow 1.2)" for some developers and in some circumstances. Found by valgrind. Reported-by: Justin Pettit Signed-off-by: Ben Pfaff --- lib/vconn.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/vconn.c b/lib/vconn.c index ea1e13012..bf40b1b60 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -1112,17 +1112,13 @@ void vconn_init(struct vconn *vconn, struct vconn_class *class, int connect_status, const char *name, uint32_t allowed_versions) { + memset(vconn, 0, sizeof *vconn); vconn->class = class; vconn->state = (connect_status == EAGAIN ? VCS_CONNECTING : !connect_status ? VCS_SEND_HELLO : VCS_DISCONNECTED); vconn->error = connect_status; - vconn->version = 0; vconn->allowed_versions = allowed_versions; - vconn->remote_ip = 0; - vconn->remote_port = 0; - vconn->local_ip = 0; - vconn->local_port = 0; vconn->name = xstrdup(name); ovs_assert(vconn->state != VCS_CONNECTING || class->connect); } -- 2.43.0