From 6a279b0738fe7e2603a77cf56139f9b06b853e5b Mon Sep 17 00:00:00 2001
From: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Date: Fri, 18 Apr 2014 11:13:01 +0900
Subject: [PATCH] ofproto-dpif-upcall: Don't use stack garbage

Catched by "learning action - self-modifying flow with hard_timeout"
test case.

The bug introduced by commit b256dc52.
("ofproto-dpif-xlate: Cache xlate_actions() effects.")

Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
---
 ofproto/ofproto-dpif-upcall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 000f5c074..4ee5bf59c 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1255,7 +1255,6 @@ revalidate_ukey(struct udpif *udpif, struct udpif_flow_dump *udump,
     xoutp = NULL;
     actions = NULL;
     netflow = NULL;
-    may_learn = push.n_packets > 0;
 
     /* If we don't need to revalidate, we can simply push the stats contained
      * in the udump, otherwise we'll have to get the actions so we can check
@@ -1289,6 +1288,7 @@ revalidate_ukey(struct udpif *udpif, struct udpif_flow_dump *udump,
         goto exit;
     }
 
+    may_learn = push.n_packets > 0;
     if (ukey->xcache && !udump->need_revalidate) {
         xlate_push_stats(ukey->xcache, may_learn, &push);
         ok = true;
-- 
2.47.0