ofp-util: Ignore out_group in flow_mods for commands other than delete.
authorBen Pfaff <blp@nicira.com>
Fri, 6 Dec 2013 05:29:14 +0000 (21:29 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 21 Jan 2014 17:53:38 +0000 (09:53 -0800)
OpenFlow 1.1 through 1.4 say that the out_group in a flow_mod, for commands
other than OFPFC_DELETE or OFPFC_DELETE_STRICT, should be ignored.  OVS
actually reported an error.  This fixes the problem.

Reported-by: chen zhang <3zhangchen9211@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
lib/ofp-util.c

diff --git a/AUTHORS b/AUTHORS
index 218fe76..d8b579f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -246,6 +246,7 @@ Yeming Zhao             zhaoyeming@gmail.com
 Ying Chen               yingchen@vmware.com
 Yongqiang Liu           liuyq7809@gmail.com
 ankur dwivedi           ankurengg2003@gmail.com
+chen zhang              3zhangchen9211@gmail.com
 kk yap                  yapkke@stanford.edu
 likunyun                kunyunli@hotmail.com
 rahim entezari          rahim.entezari@gmail.com
index a0a372f..c7cc701 100644 (file)
@@ -1559,13 +1559,11 @@ ofputil_decode_flow_mod(struct ofputil_flow_mod *fm,
         if (error) {
             return error;
         }
-        fm->out_group = ntohl(ofm->out_group);
 
-        if ((ofm->command == OFPFC_DELETE
-             || ofm->command == OFPFC_DELETE_STRICT)
-            && ofm->out_group != htonl(OFPG_ANY)) {
-            return OFPERR_OFPFMFC_UNKNOWN;
-        }
+        fm->out_group = (ofm->command == OFPFC_DELETE ||
+                         ofm->command == OFPFC_DELETE_STRICT
+                         ? ntohl(ofm->out_group)
+                         : OFPG11_ANY);
         raw_flags = ofm->flags;
     } else {
         uint16_t command;