From 1fe4c0a0ca8a04a0fd830fea4e565cc39a58e584 Mon Sep 17 00:00:00 2001
From: Ben Pfaff <blp@nicira.com>
Date: Thu, 5 Dec 2013 21:29:14 -0800
Subject: [PATCH] ofp-util: Ignore out_group in flow_mods for commands other
 than delete.

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        |  1 +
 lib/ofp-util.c | 10 ++++------
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 218fe7626..d8b579f10 100644
--- 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
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index a0a372f8c..c7cc70138 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -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;
-- 
2.47.0