From: Ben Pfaff Date: Wed, 18 Mar 2009 17:28:27 +0000 (-0700) Subject: dpif: Clear stats before deleting or query flows. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f747522cad8b5b91011e872a9bdbd993c7ae62d;p=openvswitch dpif: Clear stats before deleting or query flows. This placates Valgrind, but it also makes results more reproducible if a caller does not check the return value. --- diff --git a/lib/dpif.c b/lib/dpif.c index 589d9746..ce36fb97 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -468,6 +468,7 @@ int dpif_flow_del(struct dpif *dpif, struct odp_flow *flow) { check_rw_odp_flow(flow); + memset(&flow->stats, 0, sizeof flow->stats); return do_flow_ioctl(dpif, ODP_FLOW_DEL, flow, "delete flow", true); } @@ -475,6 +476,7 @@ int dpif_flow_query(const struct dpif *dpif, struct odp_flow *flow) { check_rw_odp_flow(flow); + memset(&flow->stats, 0, sizeof flow->stats); return do_flow_ioctl(dpif, ODP_FLOW_QUERY, flow, "query flow", true); }