[ovs-dev] [PATCH 1/2] ofproto: Don't optimize out updating flow cookie.

Ben Pfaff blp at nicira.com
Fri Mar 19 19:49:52 UTC 2010


The OFPFC_MODIFY and OFPFC_MODIFY_STRICT optimizes out modifying the
actions if the actions didn't change, but it also skipped updating the
flow cookie in that case, which seems wrong.  This commit fixes the
problem.
---
 ofproto/ofproto.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index fcc76d6..9efc96e 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2929,6 +2929,7 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm,
     } else {
         size_t actions_len = n_actions * sizeof *rule->actions;
 
+        rule->flow_cookie = ofm->cookie;
         if (n_actions == rule->n_actions
             && !memcmp(ofm->actions, rule->actions, actions_len))
         {
@@ -2938,7 +2939,6 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm,
         free(rule->actions);
         rule->actions = xmemdup(ofm->actions, actions_len);
         rule->n_actions = n_actions;
-        rule->flow_cookie = ofm->cookie;
 
         if (rule->cr.wc.wildcards) {
             COVERAGE_INC(ofproto_mod_wc_flow);
-- 
1.6.6.1





More information about the dev mailing list