Skip to content

Commit

Permalink
ematch: Fix matching of inverted containers.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
iazz authored and davem330 committed Sep 29, 2014
1 parent 73d3fe6 commit 17c9c82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/sched/ematch.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,11 @@ 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_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;
}
Expand Down

0 comments on commit 17c9c82

Please sign in to comment.