[ovs-dev] [PATCH 1/2] test-classifier: Ensure priority is not negative.

Jarno Rajahalme jrajahalme at nicira.com
Fri Oct 31 21:17:56 UTC 2014


Classifier users should not use negative priorities.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
---
 tests/test-classifier.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/test-classifier.c b/tests/test-classifier.c
index 9a58a18..67bcbc6 100644
--- a/tests/test-classifier.c
+++ b/tests/test-classifier.c
@@ -641,7 +641,9 @@ make_rule(int wc_fields, int priority, int value_pat)
     }
 
     rule = xzalloc(sizeof *rule);
-    cls_rule_init(&rule->cls_rule, &match, wc_fields ? priority : INT_MAX);
+    cls_rule_init(&rule->cls_rule, &match, wc_fields
+                  ? (priority < 0 ? -priority: priority)
+                  : INT_MAX);
     return rule;
 }
 
-- 
1.7.10.4




More information about the dev mailing list