Commit 17c9c823 authored by Ignacy Gawędzki's avatar Ignacy Gawędzki Committed by David S. Miller

ematch: Fix matching of inverted containers.

Negated expressions and sub-expressions need to have their flags checked for
TCF_EM_INVERT and their result negated accordingly.
Signed-off-by: default avatarIgnacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73d3fe6d
...@@ -526,9 +526,11 @@ int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree, ...@@ -526,9 +526,11 @@ int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree,
match_idx = stack[--stackp]; match_idx = stack[--stackp];
cur_match = tcf_em_get_match(tree, match_idx); 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; goto pop_stack;
else { } else {
match_idx++; match_idx++;
goto proceed; goto proceed;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment