ofproto-dpif-upcall: Don't use stack garbage
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Fri, 18 Apr 2014 02:13:01 +0000 (11:13 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Sun, 20 Apr 2014 03:46:07 +0000 (12:46 +0900)
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

index 000f5c0..4ee5bf5 100644 (file)
@@ -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;