ofp-parse: ofp-parse fails to properly validate DROP.
authorEthan Jackson <ethan@nicira.com>
Sun, 2 Jan 2011 20:52:11 +0000 (12:52 -0800)
committerEthan Jackson <ethan@nicira.com>
Sun, 2 Jan 2011 21:17:05 +0000 (13:17 -0800)
The str_to_action function of ofp-parse was not properly
incrementing it's actions counter.  Thus it did not enforce the
requirement that DROP actions not be preceded by other actions.

lib/ofp-parse.c

index e30c8a9..f8464b9 100644 (file)
@@ -200,6 +200,7 @@ str_to_action(char *str, struct ofpbuf *b)
     char *pos;
 
     pos = str;
+    n_actions = 0;
     for (;;) {
         char *act, *arg;
         size_t actlen;
@@ -414,6 +415,7 @@ str_to_action(char *str, struct ofpbuf *b)
         } else {
             ovs_fatal(0, "Unknown action: %s", act);
         }
+        n_actions++;
     }
 }