Skip to content

Commit

Permalink
ematch: Fix early ending of inverted containers.
Browse files Browse the repository at this point in the history
The result of a negated container has to be inverted before checking for
early ending.

This fixes my previous attempt (17c9c82) to
make inverted containers work correctly.

Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ignacy Gawędzki authored and David S. Miller committed Oct 5, 2014
1 parent e87474a commit 34a419d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/sched/ematch.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,10 @@ int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree,
match_idx = stack[--stackp];
cur_match = tcf_em_get_match(tree, match_idx);

if (tcf_em_is_inverted(cur_match))
res = !res;

if (tcf_em_early_end(cur_match, res)) {
if (tcf_em_is_inverted(cur_match))
res = !res;
goto pop_stack;
} else {
match_idx++;
Expand Down

0 comments on commit 34a419d

Please sign in to comment.