[ovs-dev] [PATCH] ofp-parse: Fix parsing of "resubmit" action.

Justin Pettit jpettit at nicira.com
Thu Jul 19 07:45:19 UTC 2012


The new abstraction introduced in commit f25d0cf (Introduce ofpacts, an
abstraction of OpenFlow actions.) provides a mechanism for storing the
original action type for when converting from the internal representation
to a public one may be ambiguous.  The "resubmit" action must
distinguish between OFPUTIL_NXAST_RESUBMIT_TABLE and
OFPUTIL_NXAST_RESUBMIT, so the parsing function needs to properly fill
out the "compat" member of the ofpact structure.

Bug #8899
Reported-by: Luca Giraudo <lgiraudo at nicira.com>
Signed-off-by: Justin Pettit <jpettit at nicira.com>
---
 lib/ofp-parse.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 32d3836..0d983df 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -176,7 +176,13 @@ parse_resubmit(char *arg, struct ofpbuf *ofpacts)
     }
 
     table_s = strsep(&arg, ",");
-    resubmit->table_id = table_s && table_s[0] ? str_to_u32(table_s) : 255;
+    if (table_s && table_s[0]) {
+        resubmit->table_id = str_to_u32(table_s);
+        resubmit->ofpact.compat = OFPUTIL_NXAST_RESUBMIT_TABLE;
+    } else {
+        resubmit->table_id = 255;
+        resubmit->ofpact.compat = OFPUTIL_NXAST_RESUBMIT;
+    }
 
     if (resubmit->in_port == OFPP_IN_PORT && resubmit->table_id == 255) {
         ovs_fatal(0, "at least one \"in_port\" or \"table\" must be specified "
-- 
1.7.5.4




More information about the dev mailing list