ematch: Fix matching of inverted containers.
authorIgnacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Wed, 24 Sep 2014 16:38:39 +0000 (18:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Sep 2014 19:31:29 +0000 (15:31 -0400)
Negated expressions and sub-expressions need to have their flags checked for
TCF_EM_INVERT and their result negated accordingly.

Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/ematch.c

index 3a633de..ad57f44 100644 (file)
@@ -526,9 +526,11 @@ pop_stack:
                match_idx = stack[--stackp];
                cur_match = tcf_em_get_match(tree, match_idx);
 
-               if (tcf_em_early_end(cur_match, res))
+               if (tcf_em_early_end(cur_match, res)) {
+                       if (tcf_em_is_inverted(cur_match))
+                               res = !res;
                        goto pop_stack;
-               else {
+               else {
                        match_idx++;
                        goto proceed;
                }