[ovs-dev] [PATCH] ofp-parse: ofp-parse fails to properly validate DROP.

Simon Horman horms at verge.net.au
Sun Jan 2 23:55:29 UTC 2011


From: Ethan Jackson <ethan at nicira.com>

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 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index e30c8a9..f8464b9 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -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++;
     }
 }
 
-- 
1.7.2.3





More information about the dev mailing list