From 8bc0fb9652488bef87f569a62431a8482c1c072e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 5 Mar 2009 17:00:46 -0800 Subject: [PATCH] dpif: Suppress spurious error from Valgrind. --- lib/dpif.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/dpif.c b/lib/dpif.c index 0f5908fa..aa75f58c 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -59,6 +59,7 @@ #include "packets.h" #include "poll-loop.h" #include "util.h" +#include "valgrind.h" #include "vlog.h" #define THIS_MODULE VLM_dpif @@ -425,9 +426,13 @@ dpif_flow_list(const struct dpif *dpif, struct odp_flow flows[], size_t n, fv.flows = flows; fv.n_flows = n; - for (i = 0; i < n; i++) { - flows[i].actions = NULL; - flows[i].n_actions = 0; + if (RUNNING_ON_VALGRIND) { + memset(flows, 0, n * sizeof *flows); + } else { + for (i = 0; i < n; i++) { + flows[i].actions = NULL; + flows[i].n_actions = 0; + } } error = IOCTL(dpif, ODP_FLOW_LIST, &fv); *n_out = error ? 0 : fv.n_flows; -- 2.30.2