ofproto: Revert change in flow cookie when an ofoperation fails.
authorBen Pfaff <blp@nicira.com>
Fri, 6 Jul 2012 17:36:00 +0000 (10:36 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 12 Jul 2012 21:12:59 +0000 (14:12 -0700)
The flow_cookie member of struct ofoperation has always been there, but it
seems that it's never been used.  This fixes the code so that if a modify
operation fails the rule's original flow cookie is restored.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto.c

index dfa83e56eb564aff9812ed34bc207d5ca5201389..66e8bb86c62cf73842347ed0ae5b93ee9bc43580 100644 (file)
@@ -3650,6 +3650,7 @@ ofopgroup_complete(struct ofopgroup *group)
             if (!op->error) {
                 rule->modified = time_msec();
             } else {
+                rule->flow_cookie = op->flow_cookie;
                 free(rule->ofpacts);
                 rule->ofpacts = op->ofpacts;
                 rule->ofpacts_len = op->ofpacts_len;