Skip to content

Commit 17c9c82

Browse files
iazzdavem330
authored andcommitted
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 <ignacy.gawedzki@green-communications.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 73d3fe6 commit 17c9c82

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎net/sched/ematch.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,11 @@ int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree,
526526
match_idx = stack[--stackp];
527527
cur_match = tcf_em_get_match(tree, match_idx);
528528

529-
if (tcf_em_early_end(cur_match, res))
529+
if (tcf_em_early_end(cur_match, res)) {
530+
if (tcf_em_is_inverted(cur_match))
531+
res = !res;
530532
goto pop_stack;
531-
else {
533+
} else {
532534
match_idx++;
533535
goto proceed;
534536
}

0 commit comments

Comments
 (0)