From: Ignacy Gawędzki Date: Wed, 24 Sep 2014 16:38:39 +0000 (+0200) Subject: ematch: Fix matching of inverted containers. X-Git-Tag: v3.17~14^2~9 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=17c9c8232663a47f074b7452b9b034efda868ca7;p=linux.git 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: Ignacy Gawędzki Signed-off-by: David S. Miller --- diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 3a633debb6df..ad57f4444b9c 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c @@ -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; }