X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif.c;h=186f165c1745558883b4e8fed88874433e4cec04;hb=7103dec49eb569c3196239da6c178a29c3003e2b;hp=8e5cf9ffcb36af7650f6485a46456b9289907e45;hpb=e278140516c5fce346d882dd9ac51558f17cd14c;p=openvswitch diff --git a/lib/dpif.c b/lib/dpif.c index 8e5cf9ff..186f165c 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -724,6 +724,11 @@ dpif_flow_get(const struct dpif *dpif, struct odp_flow *flow) if (!error) { error = flow->stats.error; } + if (error) { + /* Make the results predictable on error. */ + memset(&flow->stats, 0, sizeof flow->stats); + flow->n_actions = 0; + } if (should_log_flow_message(error)) { log_flow_operation(dpif, "flow_get", error, flow); }