From: Ben Pfaff Date: Fri, 19 Mar 2010 18:44:31 +0000 (-0700) Subject: ofproto: Don't optimize out updating flow cookie. X-Git-Tag: v1.0.0~229 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=4c77ea7fe06f9a09942e103d6fc42d37922b90fa;p=sliver-openvswitch.git ofproto: Don't optimize out updating flow cookie. 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. --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index fcc76d6cb..9efc96eb7 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);